next up previous contents index
Next: Ranges Up: Basic Usage Previous: Creating a Blank Document   Contents   Index

Writing PDF to Files and Memory

Writing a PDF to file is achieved with the ToFile function. The arguments are the PDF, the filename and two booleans - the first is true if the file is to be linearized, the second if a new /ID is to be made for the file.
\begin{framed}
\noindent\textit{Writing a File}\\
\par
\noindent\begin{tabular}...
...t linearized, but a new /ID is made - hence \texttt{false, true}.)}
\end{framed}

To write a file encrypted, use ToFileEncrypted.


\begin{framed}
\noindent\textit{Encryption Methods}
\par
\vspace{2mm}
\noindent\...
...(false)!\\
\small\verb!Pdfwrite.encryption_method.AES128bit(true)!
\end{framed}
Here are the possible permissions:


\begin{framed}
\begin{tabular}{ll}
\multicolumn{2}{l}{\textit{Using any form of ...
...
\verb!Pdfcrypt.NoHqPrint! & Cannot print high-quality
\end{tabular}\end{framed}

So to write a file encypted, we pass the PDF object, an encryption method, an array of permissions, an owner password, user password, linearize flag and the filename.


\begin{framed}
\noindent\textit{Writing a File Encrypted}\\
\par
\noindent\begi...
... !\>\textit{Output file}\\
\end{tabbing}\end{minipage}\end{tabular}\end{framed}



root 2008-12-01