Product: PDFTron Javascript/Node/WebViewer
Product Version: latest
Please give a brief summary of your issue:
How can I get the relative coordinate actions (m, l, c, r, h, H, v, V) from path data to create svg?
Please describe your issue and provide steps to reproduce it:
I am trying to load a pdf that includes vector data and extract the vectors as paths (svg) into memory.
When I use Convert.docToSvg() from the node api, I get the svg data I would expect. However this method saves the file to disk. I would like to extract the path/vector data to memory without the need to write to disk. Ideally using WebViewer but Node would also work.
I found the following advanced example on pdf data extraction (PDFTron Systems Inc. | Documentation), and have been following this but I can not find any documentation that gives me the relative path commands - PathSegmentType in the example only gives basic command data (move_to, curve_to) but svgs use absolute and relative commands to inform the point data.
The example above assumes absolute SVG commands (M,C,R,L,…), which does not produce the same svg data.
I assume the code exists to get the relative commans for Convert.docToSvg() to work correctly…?
Is there a way of either a) extracting svg/path data without a write to disk or b) accessing the relative svg commands?
Please provide a link to a minimal sample where the issue is reproducible: