2

I have a gazillion editable PDF files. I would like to make them non editable by printing to PDF. How can I do it on the windows command line?

My ultimate goal is to make PDF non editable and do this en masse. I found out that printing to PDF does make it non editable, but I am open to other options.

mark
  • 876

3 Answers3

1

Very easy to use SumatraPDF portable to regenerate via Microsoft PDF since I support SumatraPDF and have to explain why it may not be what you expect, or really need.

Printing PDF as Image based PDF will bloat them horribly and introduce the need for compression. That compression will then be a temptation to degrade to a lower quality slower speed of rendering.

PDF is designed to be fast as lighter line vectors rather than drawing dot by dot.

Once converted to Images you cannot go back except run via automated OCR. Actually that is very good these days at replacing those bloated images so they can be deleted to get a faster read/editable file.

A secondary issue is that Microsoft Print to PDF can be run unattended as long as the format is fixed to say just landscape OR portrait. Thus often not good for files that include both or variable page sizes.

Others suggest you use settings to protect the file usage , well forget that. Most PDF viewers are editors of forms and comments thus to add to a PDF it needs to be unprotected and Adobe manage that aspect, but most other viewers simply ignore that management need.

K J
  • 1,248
0

You can use Adobe Acrobat Pro to print to PDF. Adobe Acrobat Pro also allows you to perform batch processing, so you can batch print to PDF.

enter image description here

See https://forums.adobe.com/thread/2540164 (mirror) for more details.

Disclaimer: at the time I write this post (2019-06-01), I work for Adobe.

Franck Dernoncourt
  • 24,246
  • 64
  • 231
  • 400
0

In order for a PDF to not be editable, it must be secured with encryption using a PDF editor; even then, if the PDF is Printed to PDF, the encryption and/or its digital signature does not go with it (printing can be restricted when securing, but often this creates more problems than it solves)

  • This is common in business transactions and to prevent this very thing, the PDF, whether secured or not, will have a digital signature attached to it to verify it's the unmodified original

If the issue is wanting to make locally stored PDFs non-editable, ACLs would be used to restrict a user's ability to modify the file itself:

  • GUI:
    1. PropertiesSecurityAdvanced
    2. Remove users with Modify permissions
    3. AddSelect a princialEnter the object name to select [user/group]
    4. Select Read & execute → OK → OK

  • Cmd:
    ::# Set PDF file or directory variable:
        Set PDF="%UserProfile%\Path\to\PDF"
    

    ::# Remove inheritance: Icacls %PDF% /c /t /Inheritance:d

    ::# Remove all users, including Owner: ::# If file/directory is outside of %UserProfile%: TakeOwn /F %PDF%

    Icacls %PDF% /c /t /Remove:g "Authenticated Users" BUILTIN\Administrators BUILTIN Everyone System %UserName% Users
    
    

    ::# Set Read & execute permissions for User: Icacls %PDF% /c /t /Grant:r %UserName%:RX

    ::# Verify: Icacls %PDF%

    ::# Remove Variable: set "PDF="


  • PowerShell:
    # Set PDF file or directory variable:
      New-Variable -Name Key -Value "$env:UserProfile\path\to\PDF"
    

    Remove Inheritance:

    Icacls $PDF /c /t /Inheritance:d

    Remove all users, including Owner:

    If file/directory is outside of $env:UserProfile:

    TakeOwn /F $PDF
    
    

    Icacls $PDF /c /t /Remove:g "Authenticated Users" BUILTIN\Administrators BUILTIN Everyone System $env:UserName Users

    Set Read & execute permissions for User:

    Icacls $PDF /c /t /Grant:r $env:UserName:RX

    Verify:

    Icacls $PDF

    Remove Variable:

    Remove-Variable -Name PDF

JW0914
  • 9,096