.net - how to extract separate vector graphic from pdf per layer -
i have pdf document many layers (ocgs). doc has 1 page. there few bitmap images , many vector graphics in doc. each of vector graphics related 1 of layer (ocg).
i need extract vector graphics document. tried use tools gsview , inkscape , got 1 huge svg document. unfortunately, need extract separate graphics each of layers (ocgs).
i tried use libraries abcpdf, aspose , itextsharp, didn't need. yes, can add vector graphics pdf using itextsharp, need extract it. probably, 1 of these libraries offer suitable solution didn't find during several hours of researching.
now i'm digging in acrobat sdk, i'm new this, , experience c/c++ poor.(
if still looking solution, xfinium.pdf library supports feature.
code below shows how feature works (extracts optional content 1 page , draws on another):
filestream input = file.openread("optionalcontent-src.pdf"); pdffile file = new pdffile(input); int pagenumber = 0; string ocgname = "sampleocg"; pdfpageoptionalcontent ocg = file.extractpageoptionalcontentgroup(pagenumber, ocgname); input.close() pdffixeddocument document = new pdffixeddocument(); pdfpage page = document.pages.add(); page.graphics.drawformxobject(ocg, 0, 0, page.width / 2, page.height / 2); document.save("optionalcontent-dest.pdf")
the optional content extracted name.
disclaimer: work company develops product.
Comments
Post a Comment