Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-1776

Print pdf with font embedded(SimSun TrueType(CID) Identity-H)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.2
    • 2.0.0
    • FontBox
    • None
    • Windows 7, tomcat 6, java 6

    Description

      Hello,
      Can you please help me on the issue as below?
      [Issue]
      print PDF file witch has font embedded subset.

      I am trying to use PDFBOX 1.8.2 to print PDF file.
      When I use printJob.print() to print PDF file, I got the error like this:

      <2013/11/08 11:14:53 org.apache.pdfbox.filter.FlateFilter decode
      fatal: FlateFilter: stop reading corrupt stream due to a DataFormatException>

      And I checked the property of the PDF file and it's like below:
      [Font]
      SimSun(embedded subset)
      type: TrueType(CID)
      enconding: Identity-H

      Here is my java Code:
      [Code]
      PDDocument document = PDDocument.load( pdfFileName );
      PrinterJob printJob = PrinterJob.getPrinterJob();
      printJob.setJobName(new File(pdfFileName).getName());
      if(printerName != null )
      {
      PrintService[] printService = PrinterJob.lookupPrintServices();
      boolean printerFound = false;
      for(int i = 0; !printerFound && i < printService.length; i++)
      {
      if(printService[i].getName().indexOf(printerName) != -1)

      { printJob.setPrintService(printService[i]); printerFound = true; }

      }
      }
      printJob.setPageable(new PDPageable(document, printJob));
      if( silentPrint || printJob.printDialog())

      { printJob.print(); }

      I'm sorry, i can't find the way to attatch the pdf file.

      Is it possible for PDFBOX 1.8.2 to print pdf properly?
      what about PDFBOX 2.0?

      Thanks in advance.
      Regards

      Attachments

        1. GSP_PRFACT.pdf
          309 kB
          Jin Gang
        2. PDFBOX-1776.pdf-1.png
          296 kB
          Tilman Hausherr

        Activity

          People

            lehmi Andreas Lehmkühler
            jingang Jin Gang
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: