Examples of PdfName


Examples of com.itextpdf.text.pdf.PdfName

        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

Examples of com.lowagie.text.pdf.PdfName

  }

  public static PdfViewerPreferencesImp getViewerPreferences(PdfDictionary catalog) {
    PdfViewerPreferencesImp preferences = new PdfViewerPreferencesImp();
    int prefs = 0;
    PdfName name = null;
    // page layout
    PdfObject obj = PdfReader.getPdfObjectRelease(catalog.get(PdfName.PAGELAYOUT));
    if (obj != null && obj.isName()) {
      name = (PdfName) obj;
      if (name.equals(PdfName.SINGLEPAGE))
        prefs |= PdfWriter.PageLayoutSinglePage;
      else if (name.equals(PdfName.ONECOLUMN))
        prefs |= PdfWriter.PageLayoutOneColumn;
      else if (name.equals(PdfName.TWOCOLUMNLEFT))
        prefs |= PdfWriter.PageLayoutTwoColumnLeft;
      else if (name.equals(PdfName.TWOCOLUMNRIGHT))
        prefs |= PdfWriter.PageLayoutTwoColumnRight;
      else if (name.equals(PdfName.TWOPAGELEFT))
        prefs |= PdfWriter.PageLayoutTwoPageLeft;
      else if (name.equals(PdfName.TWOPAGERIGHT))
        prefs |= PdfWriter.PageLayoutTwoPageRight;
    }
    // page mode
    obj = PdfReader.getPdfObjectRelease(catalog.get(PdfName.PAGEMODE));
    if (obj != null && obj.isName()) {
      name = (PdfName) obj;
      if (name.equals(PdfName.USENONE))
        prefs |= PdfWriter.PageModeUseNone;
      else if (name.equals(PdfName.USEOUTLINES))
        prefs |= PdfWriter.PageModeUseOutlines;
      else if (name.equals(PdfName.USETHUMBS))
        prefs |= PdfWriter.PageModeUseThumbs;
      else if (name.equals(PdfName.USEOC))
        prefs |= PdfWriter.PageModeUseOC;
      else if (name.equals(PdfName.USEATTACHMENTS))
        prefs |= PdfWriter.PageModeUseAttachments;
    }
    // set page layout and page mode preferences
    preferences.setViewerPreferences(prefs);
    // other preferences
View Full Code Here

Examples of com.lowagie.text.pdf.PdfName

    public void completeInfoDictionary(PdfDictionary info) {
        if (isPdfX() && !isPdfA1()) {
            if (info.get(PdfName.GTS_PDFXVERSION) == null) {
                if (isPdfX1A2001()) {
                    info.put(PdfName.GTS_PDFXVERSION, new PdfString("PDF/X-1:2001"));
                    info.put(new PdfName("GTS_PDFXConformance"), new PdfString("PDF/X-1a:2001"));
                }
                else if (isPdfX32002())
                    info.put(PdfName.GTS_PDFXVERSION, new PdfString("PDF/X-3:2002"));
            }
            if (info.get(PdfName.TITLE) == null) {
                info.put(PdfName.TITLE, new PdfString("Pdf document"));
            }
            if (info.get(PdfName.CREATOR) == null) {
                info.put(PdfName.CREATOR, new PdfString("Unknown"));
            }
            if (info.get(PdfName.TRAPPED) == null) {
                info.put(PdfName.TRAPPED, new PdfName("False"));
            }
        }
    }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfName

        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

Examples of com.lowagie.text.pdf.PdfName

    /**
     * A content operator implementation (gs).
     */
    private static class ProcessGraphicsStateResource implements ContentOperator{
        public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList operands) {
            PdfName dictionaryName = (PdfName)operands.get(0);
            PdfDictionary extGState = processor.resources.getAsDict(PdfName.EXTGSTATE);
            if (extGState == null)
                throw new IllegalArgumentException("Resources do not contain ExtGState entry. Unable to process operator " + operator);
            PdfDictionary gsDic = extGState.getAsDict(dictionaryName);
            if (gsDic == null)
View Full Code Here

Examples of com.lowagie.text.pdf.PdfName

    static public String getDictionaryDetail(PdfDictionary dic, int depth){
        StringBuffer builder = new StringBuffer();
        builder.append('(');
        List subDictionaries = new ArrayList();
        for (Iterator i = dic.getKeys().iterator(); i.hasNext(); ) {
            PdfName key = (PdfName)i.next();
            PdfObject val = dic.getDirectObject(key);
            if (val.isDictionary())
                subDictionaries.add(key);
            builder.append(key);
            builder.append('=');
            builder.append(val);
            builder.append(", ");
        }
        builder.setLength(builder.length()-2);
        builder.append(')');
        PdfName pdfSubDictionaryName;
        for (Iterator it = subDictionaries.iterator(); it.hasNext(); ) {
          pdfSubDictionaryName = (PdfName)it.next();
            builder.append('\n');
            for(int i = 0; i < depth+1; i++){
                builder.append('\t');
View Full Code Here

Examples of com.lowagie.text.pdf.PdfName

    /**
     * A content operator implementation (Tf).
     */
    private static class SetTextFont implements ContentOperator{
        public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList operands) {
            PdfName fontResourceName = (PdfName)operands.get(0);
            float size = ((PdfNumber)operands.get(1)).floatValue();
           
            PdfDictionary fontsDictionary = processor.resources.getAsDict(PdfName.FONT);
            CMapAwareDocumentFont font = new CMapAwareDocumentFont((PRIndirectReference)fontsDictionary.get(fontResourceName));
           
View Full Code Here

Examples of com.lowagie.text.pdf.PdfName

    this.pdfContentByte = pdfContentByte;
   
    if (isTagged)
    {
      PdfStructureTreeRoot root = pdfWriter.getStructureTreeRoot();
      allTag = new PdfStructureElement(root, new PdfName("All"));
      root.mapRole(new PdfName("All"), new PdfName("Sect"));
      root.mapRole(new PdfName("Anchor"), PdfName.TEXT);
      String language =
        exporter.getStringParameter(
            JRPdfExporterParameter.TAG_LANGUAGE,
            JRPdfExporterParameter.PROPERTY_TAG_LANGUAGE
            );
View Full Code Here

Examples of com.lowagie.text.pdf.PdfName

 
  protected void startPageAnchor()
  {
    if (isTagged)
    {
      PdfStructureElement textTag = new PdfStructureElement(allTag, new PdfName("Anchor"));
      pdfContentByte.beginMarkedContentSequence(textTag);
    }
  }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfName

      }
     
      prop = element.getPropertiesMap().getProperty(PROPERTY_TAG_H1);
      if (prop != null && (TAG_START.equals(prop) || TAG_FULL.equals(prop)))
      {
        PdfStructureElement headingTag = new PdfStructureElement((PdfStructureElement)tagStack.peek(), new PdfName("H1"));
        pdfContentByte.beginMarkedContentSequence(headingTag);
        headingTag.put(PdfName.K, new PdfArray());
        tagStack.push(headingTag);
        isTagEmpty = true;
      }
     
      prop = element.getPropertiesMap().getProperty(PROPERTY_TAG_H2);
      if (prop != null && (TAG_START.equals(prop) || TAG_FULL.equals(prop)))
      {
        PdfStructureElement headingTag = new PdfStructureElement((PdfStructureElement)tagStack.peek(), new PdfName("H2"));
        pdfContentByte.beginMarkedContentSequence(headingTag);
        headingTag.put(PdfName.K, new PdfArray());
        tagStack.push(headingTag);
        isTagEmpty = true;
      }
     
      prop = element.getPropertiesMap().getProperty(PROPERTY_TAG_H3);
      if (prop != null && (TAG_START.equals(prop) || TAG_FULL.equals(prop)))
      {
        PdfStructureElement headingTag = new PdfStructureElement((PdfStructureElement)tagStack.peek(), new PdfName("H3"));
        pdfContentByte.beginMarkedContentSequence(headingTag);
        headingTag.put(PdfName.K, new PdfArray());
        tagStack.push(headingTag);
        isTagEmpty = true;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.