Examples of PdfName


Examples of com.lowagie.text.pdf.PdfName

  }


  protected void createTableStartTag()
  {
    PdfStructureElement tableTag = new PdfStructureElement(allTag, new PdfName("Table"));
    pdfContentByte.beginMarkedContentSequence(tableTag);
    tableTag.put(PdfName.K, new PdfArray());
    tagStack.push(tableTag);
  }
View Full Code Here

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

Examples of com.lowagie.text.pdf.PdfName

  }
   
 
  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

Examples of com.lowagie.text.pdf.PdfName

  }

 
  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

Examples of com.lowagie.text.pdf.PdfName

    {
      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

Examples of com.lowagie.text.pdf.PdfName

      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

Examples of org.apache.fop.pdf.PDFName

    public void populateXObjectDictionary(PDFDictionary dict) {
        ColorModel cm = getEffectiveColorModel();
        if (cm instanceof IndexColorModel) {
            IndexColorModel icm = (IndexColorModel)cm;
            PDFArray indexed = new PDFArray(dict);
            indexed.add(new PDFName("Indexed"));
           
            if (icm.getColorSpace().getType() != ColorSpace.TYPE_RGB) {
                log.warn("Indexed color space is not using RGB as base color space."
                        + " The image may not be handled correctly."
                        + " Base color space: " + icm.getColorSpace()
                        + " Image: " + image.getInfo());
            }
            indexed.add(new PDFName(toPDFColorSpace(icm.getColorSpace()).getName()));
            int c = icm.getMapSize();
            int hival = c - 1;
            if (hival > MAX_HIVAL) {
                throw new UnsupportedOperationException("hival must not go beyond " + MAX_HIVAL);
            }
View Full Code Here

Examples of org.pdfclown.objects.PdfName

  {
    if(baseObject == null)
      return null;

    PdfDictionary dataObject = (PdfDictionary)File.resolve(baseObject);
    PdfName actionType = (PdfName)dataObject.get(PdfName.S);
    if(actionType == null
      || (dataObject.containsKey(PdfName.Type)
          && !dataObject.get(PdfName.Type).equals(PdfName.Action)))
      return null;

    if(actionType.equals(PdfName.GoTo))
      return new GoToLocal(baseObject,container);
    else if(actionType.equals(PdfName.GoToR))
      return new GoToRemote(baseObject,container);
    else if(actionType.equals(PdfName.GoToE))
      return new GoToEmbedded(baseObject,container);
    else if(actionType.equals(PdfName.Launch))
      return new Launch(baseObject,container);
    else if(actionType.equals(PdfName.Thread))
      return new GoToThread(baseObject,container);
    else if(actionType.equals(PdfName.URI))
      return new GoToURI(baseObject,container);
    else if(actionType.equals(PdfName.Sound))
      return new PlaySound(baseObject,container);
    else if(actionType.equals(PdfName.Movie))
      return new PlayMovie(baseObject,container);
    else if(actionType.equals(PdfName.Hide))
      return new ToggleVisibility(baseObject,container);
    else if(actionType.equals(PdfName.Named))
    {
      PdfName actionName = (PdfName)dataObject.get(PdfName.N);
      if(actionName.equals(PdfName.NextPage))
        return new GoToNextPage(baseObject,container);
      else if(actionName.equals(PdfName.PrevPage))
        return new GoToPreviousPage(baseObject,container);
      else if(actionName.equals(PdfName.FirstPage))
        return new GoToFirstPage(baseObject,container);
      else if(actionName.equals(PdfName.LastPage))
        return new GoToLastPage(baseObject,container);
      else // Custom named action.
        return new NamedAction(baseObject,container);
    }
    else if(actionType.equals(PdfName.SubmitForm))
View Full Code Here

Examples of org.pdfclown.objects.PdfName

      switch(tokenType)
      {
        case Integer:
          return new PdfInteger((Integer)token);
        case Name:
          return new PdfName((String)token,true);
        case Reference:
          /*
            NOTE: Curiously, PDF references are the only primitive objects that require
            a file reference. That's because they deal with indirect objects, which are strongly
            coupled with the current state of the file: so, PDF references are the fundamental
            bridge between the token layer and the file layer.
          */
          return new PdfReference(
            (Reference)token,
            file
            );
        case Literal:
          return new PdfTextString(
            Encoding.encode((String)token)
            );
        case DictionaryBegin:
          PdfDictionary dictionary = new PdfDictionary();
          while(true)
          {
            // Key.
            moveNext(); if(tokenType == TokenTypeEnum.DictionaryEnd) break;
            PdfName key = (PdfName)parsePdfObject();
            // Value.
            moveNext();
            PdfDirectObject value = (PdfDirectObject)parsePdfObject();
            // Add the current entry to the dictionary!
            dictionary.put(key,value);
View Full Code Here

Examples of org.pdfclown.objects.PdfName

      file
      );
    PdfDictionary header = getHeader();
    for(Entry<PdfName,PdfDirectObject> entry : file.getTrailer().entrySet())
    {
      PdfName key = entry.getKey();
      if(key.equals(PdfName.Root)
        || key.equals(PdfName.Info)
        || key.equals(PdfName.ID))
      {header.put(key,entry.getValue());}
    }
  }
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.