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

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.17
    • 2.0.18, 3.0.0 PDFBox
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: