Package org.jpedal.objects

Examples of org.jpedal.objects.PdfFileInformation


    if (commonValues.isPDF() && ((decode_pdf.isOpen() || !commonValues.isPDF() || decode_pdf.getJPedalObject(PdfDictionary.Linearized)!=null))) {

            /**
       * get PRODUCER and if OCR disable text printing
       */
      PdfFileInformation currentFileInformation=decode_pdf.getFileInformationData();

      /**switch all on by default*/
      decode_pdf.setRenderMode(PdfDecoder.RENDERIMAGES+PdfDecoder.RENDERTEXT);

      String[] values=currentFileInformation.getFieldValues();
      String[] fields=currentFileInformation.getFieldNames();

      /** holding all creators that produce OCR pdf's */
      String[] ocr = {"TeleForm","dgn2pdf"};

      for(int i=0;i<fields.length;i++){
View Full Code Here


  /**
   * show document properties
   */
  private JScrollPane getPropertiesBox(String file, String path, String user_dir, long size, int pageCount,int currentPage) {

    PdfFileInformation currentFileInformation=decode_pdf.getFileInformationData();

    /**get the Pdf file information object to extract info from*/
    if(currentFileInformation!=null){

      JPanel details=new JPanel();
      details.setOpaque(true);
      details.setBackground(Color.white);
      details.setLayout(new BoxLayout(details, BoxLayout.Y_AXIS));

      JScrollPane scrollPane=new JScrollPane();
      scrollPane.setPreferredSize(new Dimension(400,300));
      scrollPane.getViewport().add(details);
      scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
      scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

      //general details
      JLabel header1=new JLabel(Messages.getMessage("PdfViewerGeneral"));
      header1.setFont(headFont);
      header1.setOpaque(false);
      details.add(header1);

      JLabel g1=new JLabel(Messages.getMessage("PdfViewerFileName")+file);
      g1.setFont(textFont);
      g1.setOpaque(false);
      details.add(g1);

      JLabel g2=new JLabel(Messages.getMessage("PdfViewerFilePath")+path);
      g2.setFont(textFont);
      g2.setOpaque(false);
      details.add(g2);

      JLabel g3=new JLabel(Messages.getMessage("PdfViewerCurrentWorkingDir")+ ' ' +user_dir);
      g3.setFont(textFont);
      g3.setOpaque(false);
      details.add(g3);

      JLabel g4=new JLabel(Messages.getMessage("PdfViewerFileSize")+size+" K");
      g4.setFont(textFont);
      g4.setOpaque(false);
      details.add(g4);

      JLabel g5=new JLabel(Messages.getMessage("PdfViewerPageCount")+pageCount);
      g5.setOpaque(false);
      g5.setFont(textFont);
      details.add(g5);


      String g6Text="PDF "+decode_pdf.getPDFVersion();

            //add in if Linearized
            if(this.decode_pdf.getJPedalObject(PdfDictionary.Linearized)!=null)
                g6Text=g6Text+" ("+Messages.getMessage("PdfViewerLinearized.text")+") ";

            JLabel g6=new JLabel(g6Text);
      g6.setOpaque(false);
      g6.setFont(textFont);
      details.add(g6);

      details.add(Box.createVerticalStrut(10));

      //general details
      JLabel header2=new JLabel(Messages.getMessage("PdfViewerProperties"));
      header2.setFont(headFont);
      header2.setOpaque(false);
      details.add(header2);

      //get the document properties
      String[] values=currentFileInformation.getFieldValues();
      String[] fields=currentFileInformation.getFieldNames();

      //add to list and display
      int count=fields.length;

      JLabel[] displayValues=new JLabel[count];
View Full Code Here

      }

      /**
       * optional tab for new XML style info
       */
      PdfFileInformation currentFileInformation=decode_pdf.getFileInformationData();
      String xmlText=currentFileInformation.getFileXMLMetaData();
      if(xmlText.length()>0){
        tabbedPane.add(getXMLInfoBox(xmlText));
        tabbedPane.setTitleAt(nextTab, "XML");
      }

View Full Code Here

      System.out.println("Or get support/consultancy");
     
    }
 
    /**get the Pdf file information object to extract info from*/
    PdfFileInformation currentFileInformation=decode_pdf.getFileInformationData();
   
    /**get the document properties*/
    String[] values=currentFileInformation.getFieldValues();
    String[] fields=currentFileInformation.getFieldNames();
   
    /**display*/
    int count=fields.length;
   
    System.out.println("Fields");
    System.out.println("======");
    for(int i=0;i<count;i++){
      System.out.println(fields[i]+" = "+values[i]);
   
   
    /**get and show any metadata*/
    System.out.println("\nMetadata");
    System.out.println("======");
    System.out.println(currentFileInformation.getFileXMLMetaData());

    /**close the pdf file*/
    decode_pdf.closePdfFile();
  }
 
View Full Code Here

TOP

Related Classes of org.jpedal.objects.PdfFileInformation

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.