java - Using sun PDF Renderer to display PDFs with embedded fonts -


I have trouble using Sun PDF's renderer package to view PDFs with embedded fonts. I have the following code that makes a buffer image from every page of the PDF to see it in my application, and when it is not embedded fonts, it works fine. However, when PDF fonts have been embedded, it does not show any text, any ideas? Also, it opens well in Adobe's PDF viewer.

  file f = new file ("C: \\ test.pdf"); File channel FC = new RandomAccessFile (f, "r"). GetChannel (); PDFFile PDFFile = New PDFFile (FCMAP (filechannel.memode.read_one, 0, FCSSE ()); (Int x = 0; x & lt; pdfFile.getNumPages (); x ++) {try {bufferedImage bi = (BufferedImage) pdfFile.getPage (x + 1) .getImage ((int) pdfFile.getPage (x + 1) .getWidth (), (pdfFile.getPage (x + 1) .getHeight (), new rectangle ((int) pdfFile.getPage (x + 1) .getWidth (), (int) pdfFile.getPage () X + 1). GetHeight ()), empty, truth, truth); } Hold (exception e) {e.printStackTrace (); I have found this by changing the PDF render from PDF renderer to PDF box, which works. much improved. More information is available. 


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -