i draw vector image on pdf apache pdfbox. this code use draw regular images pdpage page = (pdpage) document.getdocumentcatalog().getallpages().get(1); pdpagecontentstream contentstream = new pdpagecontentstream(document, page, true, true); bufferedimage _previmage = imageio.read(new fileinputstream("path/to/image.png")); pdpixelmap previmage = new pdpixelmap(document, _previmage); contentstream.drawxobject(previmage, prevx, prevy, imagewidth, imageheight); if use svg or wmf image instead of png, resulting pdf document comes corrupted. the main reason want image vector image png or jpg image looks horrible, think gets somehow compressed looks bad. vector images shouldn't happen (well, when export svg paths pdf in inkscape doesn't happen, vector paths preserved). is there way draw svg or wmf (or other vector) pdf using apache pdfbox? i'm using pdfbox 1.8, if matters. i this, not directly. in first transform svg documents in pdf documents ...
Comments
Post a Comment