protectPDF
- addBibliography
- addBookmark
- addBreak
- addCaption
- addChart
- addCitation
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addOLE
- addOnlineVideo
- addPageNumber
- addShape
- addSimpleField
- addSource
- addStructuredDocumentTag
- addSVG
- addTab
- addTable
- addTableAuthorities
- addTableContents
- addTableFigures
- addText
- addTextBox
- addWordFragment
- addWordML
- embedHTML
- addBackgroundImage
- addFooter
- addFooterSection
- addHeader
- addHeaderSection
- addLineNumbering
- addMacroFromDoc
- addPageBorders
- addProperties
- addSection
- createDocx
- createDocxAndDownload
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- importChartStyle
- importHeadersAndFooters
- importListStyle
- importStyles
- importStylesWordDefault
- modifyPageLayout
- parseStyles
- removeFooters
- removeHeaders
- setBackgroundColor
- setDecimalSymbol
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- setRTL
- clearBlocks
- cloneBlock
- deleteBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- removeTemplateVariableImage
- replaceBlock
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- setTemplateBlockSymbol
- tickCheckboxes
protectPDF


Protects the contents of a PDF document.
This method allows to protect a PDF document. One may protect the PDF from being printed, copied, etcetera.
Notice that this method does not encrypt the contents of the PDF document. This method is not secure and can be easily overriden by an experienced user.
You may find a detailed description of this package in the cryptophpdocx section of the API documentation.
source
Path to the PDF document you want to protect.
target
Path to the resulting protected PDF document.
options
The possible keys and values are (required options are shown with yellow background):
Key | Type | Description |
---|---|---|
annotations | bool | Import annotations (links, comments and others). |
permissionsBlocked | array |
|
passwordOwner | string | String to allow full access to the PDF file. |
File does not exist.
No permission set.
- phpdocx 16.0:
- exceptions display the PDF file name if the source file doesn't exist.
- removed a depecrated message implicit float message.
- phpdocx 15.5:
- cast to int object stream content indexes.
- improved annotations support.
- phpdocx 12.0:
- improved annotations support.
- phpdocx 10.0:
- annotations option.