![]() ![]() ![]() This command rasterizes document_original.pdf, making an pixel-based image of each page, at 150 DPI, and outputs the result as document_flat.pdf. ImageMagick can produce a configurable quality, multi-page, single-layer flattened PDF with rasters of each page using the following command: convert -density 150 document_original.pdf document_flat.pdf This is clearly very bad if you legally need that content to be gone from the output. You will see the text or graphics under redaction annotations for example. You can verify this flaw in Preview by using Select All, then Copy, then Paste into a TextEdit window (in rich text mode). Using gs or pdf2ps followed by ps2pdf will yield a multi-layer PDF with the content under annotations present in original form. WARNING: gs and pdf2ps|ps2pdf DO NOT Flatten PDFs! I tried this on an 8MB file the flattened PDF was 358MB! Perhaps this can be combined with a ghostscript call as in Ubuntu Tip:Howto reduce PDF file size from command line.Īny other suggestions would be appreciated. Use cups-pdf to hook into the Mac's printserver and save a PDF file instead of print.Like pdftk this flattened only the form fields. Use cupsfilter which can create PDF from many file formats.But this only flattens form fields, not stamps and other annotations. Again, not sure how to automate this on the command line. Open in Acrobat Pro and use a JavaScript function to flatten.The only way to automate seems to be to write a kludgy UI-based AppleScript, though, which I've been trying to avoid. This creates a totally flat PDF without changing the file size. Some things I've tried/considered, with their degree of success: Since I actually have many of these PDFs, I want to do this automatically on the command line. I would like to freeze (or "flatten") that PDF so that the form fields can't be changed and the annotations/stamps are no longer editable. I have a PDF with form fields, annotations, and stamps on it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |