next up previous contents index
Next: Other View Settings Up: Document Information Previous: Mark Trapped / Untrapped   Contents   Index

Get and Set Page Layout and Mode

The SetPageLayout function specifies the page layout to be used when a document is opened in, for instance, Acrobat. The possible values are provided in the layout object in the Cpdflib module:


\begin{framed}
\begin{tabular}{ll}
\texttt{SinglePage} & \vspace{2mm} \parbox{...
...pages two at a time, even numbered pages on the left}
\end{tabular}\end{framed}

For instance:


\begin{framed}
\noindent\textit{Set document to open with pages in Two Columns, ...
...Cpdflib.layout.TwoColumnRight)!
\end{minipage}\\ [5mm]
\end{tabular}\end{framed}

The page mode in a PDF file defines how a viewer should display the document when first opened and can be set with the SetPageMode function. Possible values, in the pagemode object in cpdflib are:
\begin{framed}
\begin{tabular}{ll}
\texttt{UseNone} & \vspace{2mm} \parbox{8cm...
...x{8cm}{(PDF 1.5 and above) Attachments panel visible}
\end{tabular}\end{framed}
For instance:


\begin{framed}
\noindent\textit{Set document to open with bookmarks visible}
\pa...
... Cpdflib.pagemode.UseOutlines)!
\end{minipage}\\ [5mm]
\end{tabular}\end{framed}

Page information (media box, crop box) can be returned with the function GetPageInfo, which takes a document, and returns an array of page_info objects, one for each page in the document.

Each object has two members mediabox and cropbox, each of which is a box object. A box object contains four floating point objects (minx, maxx, miny, maxy) describing the box in question. For example:


\begin{framed}
\noindent\textit{Read and print the minimum x coordinate of the m...
...ine(pageinfo(0).mediabox.minx)!
\end{minipage}\\ [5mm]
\end{tabular}\end{framed}


next up previous contents index
Next: Other View Settings Up: Document Information Previous: Mark Trapped / Untrapped   Contents   Index
root 2008-12-01