Flatten PDF

54 views
Skip to first unread message

Chirag Patel

unread,
Apr 13, 2020, 11:14:59 PM4/13/20
to pdfium
Is there a way I can use this library to flatten a PDF file that has forms filled in?

Lei Zhang

unread,
Apr 14, 2020, 12:06:41 AM4/14/20
to Chirag Patel, pdfium
Have you looked in public/fpdf_flatten.h? That's what FPDFPage_Flatten() is for.

On Mon, Apr 13, 2020 at 8:15 PM Chirag Patel <chpp...@gmail.com> wrote:
>
> Is there a way I can use this library to flatten a PDF file that has forms filled in?
>
> --
> You received this message because you are subscribed to the Google Groups "pdfium" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/23a1ba1b-654e-4700-bbd1-1cea3529459f%40googlegroups.com.

Chirag Patel

unread,
Apr 14, 2020, 12:08:46 AM4/14/20
to pdfium
Can this be done for entire file at a time? We are trying to basically make any incoming file to be flattened permanently. 

On Tuesday, April 14, 2020 at 12:06:41 AM UTC-4, Lei Zhang wrote:
Have you looked in public/fpdf_flatten.h? That's what FPDFPage_Flatten() is for.

On Mon, Apr 13, 2020 at 8:15 PM Chirag Patel <chpp...@gmail.com> wrote:
>
> Is there a way I can use this library to flatten a PDF file that has forms filled in?
>
> --
> You received this message because you are subscribed to the Google Groups "pdfium" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pdf...@googlegroups.com.

Lei Zhang

unread,
Apr 14, 2020, 12:52:16 PM4/14/20
to Chirag Patel, pdfium
If you look at the API, you can see it operates on one page at a time. However, it is not hard to write a for-loop to iterate through the pages of a PDF. FlattenPrintData() in the Chromium code base is an example of that.

To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/683a4c84-a33e-4dff-99a5-6be5fcb2f651%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages