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

Use PDFontFactory. CreateDefaultFont font to render text, the exported PDF document has a mistake

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.17
    • Fix Version/s: 2.0.18, 3.0.0 PDFBox
    • Component/s: None
    • Labels:
      None

      Description

      Using PDFontFactory. CreateDefaultFont font to render a text and save this document.

      float fontSize = 11;
      PDFont font = PDFontFactory.createDefaultFont(); 
      contentStream.beginText();  
      contentStream.newLineAtOffset(100, 100); 
      contentStream.setFont(font, fontSize);
      contentStream.showText("¥456,123"); 
      contentStream.endText();
      contentStream.close();
      
      doc.save("sample.pdf");

      Open the PDF document with Abode and throw the following error message when editing the document.

      And i opened this pdf document using the Google browser as shown below:

      Test.zip

        Attachments

        1. Test.zip
          9.40 MB
          bai yuan
        2. AdobeError.png
          46 kB
          bai yuan
        3. GoogleChrome.png
          19 kB
          bai yuan

          Issue Links

            Activity

              People

              • Assignee:
                tilman Tilman Hausherr
                Reporter:
                berylbai bai yuan
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: