java - Small rendered images from PDF slides -


i'm using ghost4j library (http://ghost4j.sourceforge.net) split pdf file of slides several images. problem have images slides in corner , small. want images format of page pdf, don't know how it. here code i'm using.

pdfdocument examplepdf = new pdfdocument(); string filepath="input.pdf"; file file=new file(filepath); examplepdf.load(file); list<org.ghost4j.document.document> docs=examplepdf.explode();  simplerenderer renderer = new simplerenderer(); renderer.setresolution(300); int counter=0; ( org.ghost4j.document.document d : docs){         list<image> img=renderer.render(d);         imageio.write((renderedimage) img.get(0), "png", new file(                 (counter+ 1) + ".png"));         counter++;         } 

i think problem in explode method doesn't take account original pdf didn't have standard pdf page size.

pd. first tried code second answer of this question gave me heap space error when document have lot of pages.

would consider using imagemagick instead?

convert -density 300 input.pdf output.png 

would give output-1.png, output-2.png, etc.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -