Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfName


  }
   
 
  protected void createTrStartTag()
  {
    PdfStructureElement tableRowTag = new PdfStructureElement((PdfStructureElement)tagStack.peek(), new PdfName("TR"));
    pdfContentByte.beginMarkedContentSequence(tableRowTag);
    tableRowTag.put(PdfName.K, new PdfArray());
    tagStack.push(tableRowTag);
  }
View Full Code Here


  }
   
 
  protected void createThStartTag(JRPrintElement element)
  {
    PdfStructureElement tableHeaderTag = new PdfStructureElement((PdfStructureElement)tagStack.peek(), new PdfName("TH"));
    pdfContentByte.beginMarkedContentSequence(tableHeaderTag);
    tableHeaderTag.put(PdfName.K, new PdfArray());
    tagStack.push(tableHeaderTag);
    isTagEmpty = true;
   
View Full Code Here

  }

 
  protected void createTdStartTag(JRPrintElement element)
  {
    PdfStructureElement tableCellTag = new PdfStructureElement((PdfStructureElement)tagStack.peek(), new PdfName("TD"));
    pdfContentByte.beginMarkedContentSequence(tableCellTag);
    tableCellTag.put(PdfName.K, new PdfArray());
    tagStack.push(tableCellTag);
    isTagEmpty = true;
   
View Full Code Here

    {
      PdfArray a = new PdfArray();
      PdfDictionary dict = new PdfDictionary();
      if (colSpan > 1)
      {
        dict.put(new PdfName("ColSpan"), new PdfNumber(colSpan));
      }
      if (rowSpan > 1)
      {
        dict.put(new PdfName("RowSpan"), new PdfNumber(rowSpan));
      }
      dict.put(PdfName.O, new PdfName("Table"));
      a.add(dict);
      parentTag.put(PdfName.A, a);
    }
  }
View Full Code Here

      if (newContext)
      {
        // add the Adobe 1.7 extensions catalog dictionary
        PdfDictionary extensions = new PdfDictionary();
        PdfDictionary adobeExtension = new PdfDictionary();
        adobeExtension.put(new PdfName("BaseVersion"), PdfWriter.PDF_VERSION_1_7);
        adobeExtension.put(new PdfName("ExtensionLevel"), new PdfNumber(3));
        extensions.put(new PdfName("ADBE"), adobeExtension);
        writer.getExtraCatalog().put(new PdfName("Extensions"), extensions);
       
        // add the swf file
        byte[] swfData = readSwf();
        PdfFileSpecification swfFile = PdfFileSpecification.fileEmbedded(writer,
            null, "Open Flash Chart", swfData);
        swfRef = writer.addToBody(swfFile);
        existingContexts.put(exporterContext, swfRef);
      }
      else
      {
        swfRef = (PdfIndirectObject) existingContexts.get(exporterContext);
      }
     
      Rectangle rect = new Rectangle(element.getX() + exporterContext.getOffsetX(),
          exporterContext.getExportedReport().getPageHeight() - element.getY() - exporterContext.getOffsetY(),
          element.getX() + exporterContext.getOffsetX() + element.getWidth(),
          exporterContext.getExportedReport().getPageHeight() - element.getY() - exporterContext.getOffsetY() - element.getHeight());
      PdfAnnotation ann = new PdfAnnotation(writer, rect);
      ann.put(PdfName.SUBTYPE, new PdfName("RichMedia"));
     
      PdfDictionary settings = new PdfDictionary();
      PdfDictionary activation = new PdfDictionary();
      activation.put(new PdfName("Condition"), new PdfName("PV"));
      settings.put(new PdfName("Activation"), activation);
      ann.put(new PdfName("RichMediaSettings"), settings);
     
      PdfDictionary content = new PdfDictionary();
     
      HashMap assets = new HashMap();
      assets.put("map.swf", swfRef.getIndirectReference());
      PdfDictionary assetsDictionary = PdfNameTree.writeTree(assets, writer);
      content.put(new PdfName("Assets"), assetsDictionary);
     
      PdfArray configurations = new PdfArray();
      PdfDictionary configuration = new PdfDictionary();
     
      PdfArray instances = new PdfArray();
      PdfDictionary instance = new PdfDictionary();
      instance.put(new PdfName("Subtype"), new PdfName("Flash"));
      PdfDictionary params = new PdfDictionary();
     
      String chartData = (String) element.getParameterValue(PARAMETER_CHART_DATA);
      String vars = "inline_data=" + chartData;
      params.put(new PdfName("FlashVars"), new PdfString(vars));
      instance.put(new PdfName("Params"), params);
      instance.put(new PdfName("Asset"), swfRef.getIndirectReference());
      PdfIndirectObject instanceRef = writer.addToBody(instance);
      instances.add(instanceRef.getIndirectReference());
      configuration.put(new PdfName("Instances"), instances);
     
      PdfIndirectObject configurationRef = writer.addToBody(configuration);
      configurations.add(configurationRef.getIndirectReference());
      content.put(new PdfName("Configurations"), configurations);
     
      ann.put(new PdfName("RichMediaContent"), content);
     
      writer.addAnnotation(ann);
    }
    catch (Exception e)
    {
View Full Code Here

                    PdfObject tuValue = null;

                    Set<PdfName> dictKeys = UtilGenerics.checkSet(dict.getKeys());
                    Iterator<PdfName> dictKeyIter = dictKeys.iterator();
                    while (dictKeyIter.hasNext()) {
                        PdfName dictKeyName = dictKeyIter.next();
                        PdfObject dictObject = dict.get(dictKeyName);

                        if ("/Type".equals(dictKeyName.toString())) {
                            typeValue = dictObject;
                        } else if ("/TU".equals(dictKeyName.toString())) {
                            tuValue = dictObject;
                        }
                        //Debug.logInfo("AcroForm widget fieldName[" + fieldName + "] dictKey[" + dictKeyName.toString() + "] dictValue[" + dictObject.toString() + "]", module);
                    }
                    if (tuValue != null && typeValue != null && "/Annot".equals(typeValue.toString())) {
View Full Code Here

        this(os);
        if (info != null) {
          DublinCoreSchema dc = new DublinCoreSchema();
          PdfSchema p = new PdfSchema();
          XmpBasicSchema basic = new XmpBasicSchema();
          PdfName key;
          PdfObject obj;
          for (Iterator it = info.getKeys().iterator(); it.hasNext();) {
            key = (PdfName)it.next();
            obj = info.get(key);
            if (obj == null)
View Full Code Here

        PdfObject newValue;
        if (cs.isName())
            newValue = cs;
        else {
            newValue = value;
            PdfName first = value.getAsName(0);
            if (PdfName.INDEXED.equals(first)) {
                if (value.size() >= 2) {
                    PdfArray second = value.getAsArray(1);
                    if (second != null) {
                        value.set(1, simplifyColorspace(second));
View Full Code Here

   * Gets a PDF Name from an array or returns the object that was passed.
   */
    private PdfObject simplifyColorspace(PdfArray obj) {
        if (obj == null)
            return obj;
        PdfName first = obj.getAsName(0);
        if (PdfName.CALGRAY.equals(first))
            return PdfName.DEVICEGRAY;
        else if (PdfName.CALRGB.equals(first))
            return PdfName.DEVICERGB;
        else
View Full Code Here

        outPath = "";
      }
      PdfDictionary catalog = reader.getCatalog();
      PdfDictionary names = catalog.getAsDict(PdfName.NAMES);
      if (names != null) {
        PdfDictionary embFiles = names.getAsDict(new PdfName("EmbeddedFiles"));
        if (embFiles != null) {
            HashMap<String, PdfObject> embMap = PdfNameTree.readTree(embFiles);
          for (Iterator<PdfObject> i = embMap.values().iterator(); i.hasNext();) {
            PdfDictionary filespec = (PdfDictionary) PdfReader
                .getPdfObject(i.next());
            unpackFile(reader, filespec, outPath);
          }
        }
      }
      for (int k = 1; k <= reader.getNumberOfPages(); ++k) {
        PdfArray annots = reader.getPageN(k).getAsArray(PdfName.ANNOTS);
        if (annots == null)
          continue;
        for (Iterator<PdfObject> i = annots.listIterator(); i.hasNext();) {
          PdfDictionary annot = (PdfDictionary) PdfReader
              .getPdfObject(i.next());
          PdfName subType = annot.getAsName(PdfName.SUBTYPE);
          if (!PdfName.FILEATTACHMENT.equals(subType))
            continue;
          PdfDictionary filespec = annot.getAsDict(PdfName.FS);
          unpackFile(reader, filespec, outPath);
        }
View Full Code Here

TOP

Related Classes of com.lowagie.text.pdf.PdfName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.