Exporting vector as an image

Product:
PDFTron PHP SDK

Product Version:
Not sure. Following the steps here
Platform: Ubuntu 18.04.6 (on Windows 10 WSL2)

Please give a brief summary of your issue:
Sample code to extract vectors as an image. Text that is drawn as vectors should be avoided.
PHT8.pdf (172.5 KB)

FYI: This portion is a vector in the PDF.

Hello, Iā€™m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Please see our ElementEdit example:

This example demonstrates removing images. You would also want to use the same method to remove text (leaving you with vector paths).

Finally, you can use our PDFDraw class to image the resulting PDF to an image file.

1 Like

Thanks for your detailed response @JoeHecht. It worked as expected. Using the PDFDraw class, have only been able to output the entire PDF as a single image.

Is there a way using which each image, or vector path, can be exported as a separate images?

Thanks!

Is there a way using which each image, or vector path, can be exported as a separate images?

Yes, however I am not sure how practical that operation would be for you.

You would need to create a separate pdf page for each image or path, then convert each page to an image.