java - Why is PDFBox deleting a rectangle line when converting to Image file -



java - Why is PDFBox deleting a rectangle line when converting to Image file -

broken converted image i seek convert pdf image file.... works fine, deletes line in 1 of rectangles.... can't figure out why.....

public static void main(string[] args) throws filenotfoundexception, ioexception { pddocument doc = pddocument.load(new fileinputstream(new file(".....pdf"))); pddocumentcatalog doccatalog = doc.getdocumentcatalog(); list pages = doccatalog.getallpages(); (object pageobj : pages) { pdpage page = (pdpage) pageobj; bufferedimage pdfimage = page.converttoimage(); imageio.write(pdfimage, "png", new file("/......png")); } doc.close(); }

before deleted text of pdf.... it still hassling 1 of text width, overwrites rectangles line ? plse see pdf here...

when trying reproduce problem, turned out current pdfbox 1.7.1 renders image. problem occurred when using old version 0.7.3.

thus, if using maven, use

<dependency> <groupid>org.apache.pdfbox</groupid> <artifactid>pdfbox</artifactid> <version>1.7.1</version> </dependency>

or newer version of dependency in case of such trouble.

java pdf pdfbox

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -