Flattening - Preview

Preview used to have the option to Print to PDF, which would flatten all layers (graphics, etc) into one. It is now gone. How can one flatten a document using Preview? Reducing the file quality using a quartz filter is not at all what I want to do, which appears to be the only close equivalent that I can find. I don’t want to buy additional software, as that’s the only feature that I really need that the paid PDF programs have.


I am hoping that there is still a way to flatten a document into one layer so that the graphics can’t be cut out using PDF editing software. Print to PDF used to accomplish that.


Thanks for any ideas!

Posted on Jan 4, 2022 3:23 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 5, 2022 6:56 AM

You can flatten image layers in the appropriate tool (e.g. Photoshop, GIMP, etc.), but not PDF. The process of creating a PDF uses up to five different compression techniques (depending on the content) to make the PDF smaller, but without setting a password on the ability to copy text, images, etc. there is no protection from selecting and copying images from the PDF.


I went back and performed a Print… PDF > Save as PDF from Pages on macOS High Sierra and Mojave. Even Pages '09 v4.3. Those PDF contained multiple images and when opened in Preview, LibreOffice v7.2, and Affinity Designer, in every instance, I could select, copy, and paste the image through the clipboard and into Preview.


In macOS Big Sur, using Pages v11.2, I also created new text and image content. Again, I did the Print… PDF > Save as PDF, and without choosing any security precautions, I got the same result as the second paragraph.


However, on the Save as PDF panel, there is a Security Option… button that takes you to this panel:



That should be self-explanatory and if the originating application provides that Print… PDF sub-menu it can be done there, or in Preview's PDF sub-menu. Once the now protected PDF is opened in Preview, one can open the Inspector (⌘i) and see that there is now a copy restriction on that PDF:



and in practice, when I select an image and attempt to copy it to the Clipboard with a ⌘C, the password prevention kicks in:



Similar questions

16 replies
Question marked as Top-ranking reply

Jan 5, 2022 6:56 AM in response to See_pee

You can flatten image layers in the appropriate tool (e.g. Photoshop, GIMP, etc.), but not PDF. The process of creating a PDF uses up to five different compression techniques (depending on the content) to make the PDF smaller, but without setting a password on the ability to copy text, images, etc. there is no protection from selecting and copying images from the PDF.


I went back and performed a Print… PDF > Save as PDF from Pages on macOS High Sierra and Mojave. Even Pages '09 v4.3. Those PDF contained multiple images and when opened in Preview, LibreOffice v7.2, and Affinity Designer, in every instance, I could select, copy, and paste the image through the clipboard and into Preview.


In macOS Big Sur, using Pages v11.2, I also created new text and image content. Again, I did the Print… PDF > Save as PDF, and without choosing any security precautions, I got the same result as the second paragraph.


However, on the Save as PDF panel, there is a Security Option… button that takes you to this panel:



That should be self-explanatory and if the originating application provides that Print… PDF sub-menu it can be done there, or in Preview's PDF sub-menu. Once the now protected PDF is opened in Preview, one can open the Inspector (⌘i) and see that there is now a copy restriction on that PDF:



and in practice, when I select an image and attempt to copy it to the Clipboard with a ⌘C, the password prevention kicks in:



Jan 5, 2022 2:22 AM in response to See_pee

You can give a PDF a password that everyone must enter to open the file. The password is used to encrypt the file.

You can also set a password to manage access to features such as printing, copying text, and adding annotations.

Open Preview for me

Set a password for opening a PDF

You can encrypt a PDF so that it requires a password to open.

  1. In the Preview app on your Mac, open a PDF or image.
  2. Choose File > Export as PDF, click the Show Details button, then select Encrypt.
  3. You can also enter a new name for the PDF if you want to create a password-protected copy and keep the original PDF unencrypted.
  4. Type a password, then retype it to verify the password.
  5. Click Save.

To remove a password from a PDF that you encrypted, open the PDF and export it again, this time turning off the encryption option.

Set permissions for a PDF

You can password-protect a PDF to manage permissions for printing, copying text and graphics, and more.

  1. In the Preview app on your Mac, open a PDF or image.
  2. Choose File > Edit Permissions.
  3. Do any of the following:
    • To set a password for opening the PDF: Select the Require Password To Open Document checkbox, type a password, then retype it to verify the password.
    • To customize permissions for a PDF: Under Permissions, select the checkbox for any actions—such as printing or adding annotations—that you want to protect with a password. Type a password, retype it to verify the password, then click Apply when you’re finished.
  1. Choose File > Save to save the permissions settings.

To remove passwords and permission-based restrictions from a PDF, open the PDF and export it.


Jan 5, 2022 8:38 AM in response to See_pee

See_pee wrote:

This is what I need! I usually export my content as a .PNG and then imbed it as a background. The quality is retained and nothing can be lifted. This is what I want to accomplish!

Are you sure about that?


You specifically asked about "flattening" a PDF. That is a very specific term with multiple meanings to different people. The suggestion to covert the file to PDF is not flattening. That is rasterizing, something completely different. That may be what solves this problem for you, but maybe not.


For context, I found this site that seems to give a fairly precise definition what it means to "flatten" a PDF file: https://pdfpen.com/blog/entry/how-to-flatten-a-pdf/


It says:

Flattening a PDF makes it so that:

1) Interactive elements in PDF forms such as checkboxes, text boxes, radio buttons, drop-down lists are no longer fillable.
2) Annotations become “native text”.
3) Multiple layers of text, images, page numbers, and header styles become one single layer.


I tried your Preview "print to PDF" flattening solution using macOS Big Sur. It behaves exactly like Preview in Monterey. Both effectively do steps 1 and 2 above. Neither do step 3, which is really a different beast altogether and completely unnecessary as far as printing goes.


Can you provide an example of URL that shows what you are talking about. Ideally, it would have both "flattened" and a "non-flattened" versions of a PDF. If you even had one that definitely had a "non-flattened" PDF, that would be really, really helpful here.


It sounds like you are looking for a solution to protect intellectual property by essentially corrupting the original graphics with other graphical elements that have been overlaid. That way, the original graphic elements cannot be extracted from the PDF. I have seen cases where this could be an issue.


However, I see no evidence that Preview ever did that or that Preview is now behaving differently. I even checked Mavericks too. It behaves the same way. It does group the graphics together, but they are still layered. It removes the fill-in capability and merges annotations, but that's all.


Preview isn't a particularly sophisticated PDF tool. That last feature of flattening that you seem to require is an advanced feature that I don't see Preview as ever being able to accomplish. I think you would need a 3rd party tool for this. I also think you were mistaken about Preview's previous capabilities. You always needed a 3rd party tool to do this.

Jan 5, 2022 8:00 AM in response to See_pee

I confess that I only tried this technique with a 2 page document. Perhaps you could experiment to determine if a smaller number of pages would work (say 25 pages). The individual sections can then be merged into a single file from Finder using Create PDF.


Another option, although tedious, would be to import the PNG files into Word (or equivalent) and then Save to PDF from the application (rather than using Preview Export to PDF).


- Pie Lover

Jan 5, 2022 7:25 AM in response to BlueberryLover

This is what I need! I usually export my content as a .PNG and then imbed it as a background. The quality is retained and nothing can be lifted. This is what I want to accomplish!


Unfortunately I’ve run into a technically issue. I have a 125 page PDF with graphics. When I export the PDF as .PNGs and that worked great! The issue is when I then try and create a PDF of the PNGs, something glitches. When I open up the PNG file in Preview, all 125 pages show up as expected and as individual files. I select all of the thumbnails and when I opt to Export as PDF, as well as when I Print/Save as a PDF, each of the 125 pages shows up as only the first page of the document. I end up with a document that is 125 pages of copies of just the first page!

Jan 5, 2022 8:29 AM in response to See_pee

If the creators of the graphic provide you with separate images, then flattening from their T&C's only applies to graphics creation programs where you place their image among other layers. If that is the case, they want you to flatten those layers before exporting the final image content. This is not applicable to word processing or presentation documents that result in the creation of PDF content.


What I have described in my post is the right approach to prevent access to any PDF image content.


The PNG image format is not multipart, so you can only export a single PDF page to a single PNG image. You would have to do this for every page in the PDF which gains you nothing. Adding those images back to Preview and then generating another PDF still does not protect those images from copying without choosing that Security Options button. This approach is a total waste of time when the same protection can be applied to the original PDF.



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Flattening - Preview

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.