17.05.2014 Views

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

PDFlib 8 Windows COM/.NET Tutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.4 Web-Optimized (Linearized) PDF<br />

<strong>PDFlib</strong> can apply a process called linearization to PDF documents (linearized PDF is also<br />

called Optimized or Fast Web View). Linearization reorganizes the objects within a PDF<br />

file and adds supplemental information which can be used for faster access.<br />

While non-linearized PDFs must be fully transferred to the client, a Web server can<br />

transfer linearized PDF documents one page at a time using a process called byteserving.<br />

It allows Acrobat (running as a browser plugin) to retrieve individual parts of a<br />

PDF document separately. The result is that the first page of the document will be presented<br />

to the user without having to wait for the full document to download from the<br />

server. This provides enhanced user experience.<br />

Note that the Web server streams PDF data to the browser, not <strong>PDFlib</strong>. Instead, <strong>PDFlib</strong><br />

prepares the PDF files for byteserving. All of the following requirements must be met in<br />

order to take advantage of byteserving PDFs:<br />

> The PDF document must be linearized. This can be achieved with the linearize option<br />

in begin_document( ) as follows:<br />

p.begin_document(outfilename, "linearize");<br />

In Acrobat you can check whether a file is linearized by looking at its document<br />

properties (»Fast Web View: yes«).<br />

> The Web server must support byteserving. The underlying byterange protocol is part<br />

of HTTP 1.1 and therefore implemented in all current Web servers.<br />

> The user must use Acrobat as a Browser plugin, and have page-at-a-time download<br />

enabled in Acrobat (Edit, Preferences, [General...,] Internet, Allow fast web view). Note<br />

that this is enabled by default.<br />

The larger a PDF file (measured in pages or MB), the more it will benefit from linearization<br />

when delivered over the Web.<br />

Note Linearizing a PDF document generally slightly increases its file size due to the additional linearization<br />

information.<br />

Temporary storage requirements for linearization. <strong>PDFlib</strong> must create the full document<br />

before it can be linearized; the linearization process will be applied in a separate<br />

step after the document has been created. For this reason <strong>PDFlib</strong> has additional storage<br />

requirements for linearization. Temporary storage will be required which has roughly<br />

the same size as the generated document (without linearization). Subject to the<br />

inmemory option in begin_document( ) <strong>PDFlib</strong> will place the linearization data either in<br />

memory or on a temporary disk file.<br />

3.4 Web-Optimized (Linearized) PDF 79

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!