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

PDPage.convertToImage special symbols

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.8.7
    • None
    • PDModel
    • None

    Description

      When converting a PDPage whit special symbols i.e: (Math Integral, Math SUM) the generates image doesn't have the symbol.

      Simple app that reproduces the issue:

      App.java
      import java.io.File;
      import java.io.IOException;
      import java.util.List;
      import java.util.logging.Level;
      import java.util.logging.Logger;
      import javax.imageio.ImageIO;
      import org.apache.pdfbox.pdmodel.PDDocument;
      import org.apache.pdfbox.pdmodel.PDPage;
      
      public class App {
      
      	public static void main(String[] args) {
      		File pdfFile = new File("C:\\Testing\\Symbols.pdf");
      		PDDocument inputPDF;
      
      		try {
      			inputPDF = PDDocument.load(pdfFile);
      			List<PDPage> allPages = inputPDF.getDocumentCatalog().getAllPages();
      			int tmp = 1;
      			for (PDPage page : allPages) {
      				File outputfile = new File("C:\\Testing\\image" + tmp + ".png");
      				ImageIO.write(page.convertToImage(), "png", outputfile);
      				System.out.println("Image Created -> " + outputfile.getName());
      				tmp++;
      			}
      			
      		} catch (IOException ex) {
      			Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
      		}
      	}
      }
      

      Attachments

        1. image1.png
          25 kB
          Gabriel Diaz
        2. Symbols.pdf
          73 kB
          Gabriel Diaz

        Issue Links

          Activity

            People

              Unassigned Unassigned
              GaboFDC Gabriel Diaz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: