Flatten PDF in PDFKit

I am opening a PDF doc and adding various annotations to it stamp, text etc . Once I fill those annotations I need to flatten the PDF but I don't find a direct way to do it.

How can we flatten a PDF with annotations?

Thanks

Accepted Reply

I recently faced this problem and solved it by
  1. Converting each page of the PDF to a rasterized image (of sufficiently high resolution)

  2. Creating a new PDF whose pages consist of the images created in step 1.

Code here

Replies

I recently faced this problem and solved it by
  1. Converting each page of the PDF to a rasterized image (of sufficiently high resolution)

  2. Creating a new PDF whose pages consist of the images created in step 1.

Code here