You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Gabriel Diaz (JIRA)" <ji...@apache.org> on 2015/08/04 10:09:04 UTC

[jira] [Created] (PDFBOX-2915) PDPage.convertToImage special symbols

Gabriel Diaz created PDFBOX-2915:
------------------------------------

             Summary: PDPage.convertToImage special symbols
                 Key: PDFBOX-2915
                 URL: https://issues.apache.org/jira/browse/PDFBOX-2915
             Project: PDFBox
          Issue Type: Bug
          Components: PDModel
    Affects Versions: 1.8.7
            Reporter: Gabriel Diaz


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:

{code:title=App.java|borderStyle=solid}
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());
			}
			
		} catch (IOException ex) {
			Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);
		}
	}
}
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org