Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.PdfName


  /**
   * Sets the value of the collection item.
   * @param d
   */
  public void addItem(String key, PdfDate d) {
    PdfName fieldname = new PdfName(key);
    PdfCollectionField field = (PdfCollectionField)schema.get(fieldname);
    if (field.fieldType == PdfCollectionField.DATE) {
      put(fieldname, d);
    }
  }
View Full Code Here


  /**
   * Sets the value of the collection item.
   * @param n
   */
  public void addItem(String key, PdfNumber n) {
    PdfName fieldname = new PdfName(key);
    PdfCollectionField field = (PdfCollectionField)schema.get(fieldname);
    if (field.fieldType == PdfCollectionField.NUMBER) {
      put(fieldname, n);
    }
  }
View Full Code Here

   * Adds a prefix for the Collection item.
   * You can only use this method after you have set the value of the item.
   * @param prefix  a prefix
   */
  public void setPrefix(String key, String prefix) {
    PdfName fieldname = new PdfName(key);
    PdfObject o = get(fieldname);
    if (o == null)
      throw new IllegalArgumentException(MessageLocalization.getComposedMessage("you.must.set.a.value.before.adding.a.prefix"));
    PdfDictionary dict = new PdfDictionary(PdfName.COLLECTIONSUBITEM);
    dict.put(PdfName.D, o);
View Full Code Here

   * Adds a Collection field to the Schema.
   * @param name  the name of the collection field
   * @param field  a Collection Field
   */
  public void addField(String name, PdfCollectionField field) {
    put(new PdfName(name), field);
  }
View Full Code Here

      OCGParser parser = new OCGParser(ocgs);
      PdfDictionary page;
    for (int i = 1; i <= n; i++) {
      page = reader.getPageN(i);
      parse(parser, page);
      page.remove(new PdfName("PieceInfo"));
      removeAnnots(page, ocgs);
      removeProperties(page, ocgs);
    }
    PdfDictionary root = reader.getCatalog();
    PdfDictionary ocproperties = root.getAsDict(PdfName.OCPROPERTIES);
View Full Code Here

    private void displayXObject(PdfName xobjectName) throws IOException {
        PdfDictionary xobjects = resources.getAsDict(PdfName.XOBJECT);
        PdfObject xobject = xobjects.getDirectObject(xobjectName);
        PdfStream xobjectStream = (PdfStream)xobject;

        PdfName subType = xobjectStream.getAsName(PdfName.SUBTYPE);
        if (xobject.isStream()){
            XObjectDoHandler handler = xobjectDoHandlers.get(subType);
            if (handler == null)
                handler = xobjectDoHandlers.get(PdfName.DEFAULT);
            handler.handleXObject(this, xobjectStream, xobjects.getAsIndirectObject(xobjectName));
View Full Code Here

    /**
     * A content operator implementation (Tf).
     */
    private static class SetTextFont implements ContentOperator{
        public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList<PdfObject> operands) {
            PdfName fontResourceName = (PdfName)operands.get(0);
            float size = ((PdfNumber)operands.get(1)).floatValue();

            PdfDictionary fontsDictionary = processor.resources.getAsDict(PdfName.FONT);
            CMapAwareDocumentFont font = processor.getFont((PRIndirectReference)fontsDictionary.get(fontResourceName));

View Full Code Here

     * A content operator implementation (gs).
     */
    private static class ProcessGraphicsStateResource implements ContentOperator{
        public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList<PdfObject> operands) {

            PdfName dictionaryName = (PdfName)operands.get(0);
            PdfDictionary extGState = processor.resources.getAsDict(PdfName.EXTGSTATE);
            if (extGState == null)
                throw new IllegalArgumentException(MessageLocalization.getComposedMessage("resources.do.not.contain.extgstate.entry.unable.to.process.operator.1", operator));
            PdfDictionary gsDic = extGState.getAsDict(dictionaryName);
            if (gsDic == null)
View Full Code Here

    private PdfDictionary getPropertiesDictionary(PdfObject operand1, ResourceDictionary resources){
            if (operand1.isDictionary())
                return (PdfDictionary)operand1;

            PdfName dictionaryName = ((PdfName)operand1);
            return resources.getAsDict(dictionaryName);
    }
View Full Code Here

    /**
     * A content operator implementation (Do).
     */
    private static class Do implements ContentOperator{
        public void invoke(PdfContentStreamProcessor processor, PdfLiteral operator, ArrayList<PdfObject> operands) throws IOException {
            PdfName xobjectName = (PdfName)operands.get(0);
            processor.displayXObject(xobjectName);
        }
View Full Code Here

TOP

Related Classes of com.itextpdf.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.