DecorateDocument: a revolutionary way to add Headers, Footers, Watermarks, and Backgrounds to PDF.
Developer use of the Datalogics PDF WebAPI has been steadily growing over the last few months as we’ve been adding new request types and capabilities to the existing ones. The Datalogics PDF WebAPI is a set of services that can be used to modify existing PDF files, fill forms and convert PDF files to images. We’ve recently updated the DecorateDocument service, so we also launched a new demonstration page where you can try it out and see the results of the PDF WebAPI for yourself.
The updated DecorateDocument service now uses a revolutionary approach that allows a developer to easily add any combination of Headers, Footers, Watermarks and Backgrounds to PDF files… using a single call… while maintaining full interoperability with Adobe Acrobat’s “Edit Page Design” features. Additional resource files for use as backgrounds or watermarks can be uploaded in the same request making even complex combinations of image backgrounds or PDF-based watermarks fast and easy to apply.
To accomplish this, the DecorateDocument service accepts an array of JSON formatted “decorationData” objects that describe what data should appear on the page. The use of a JSON array is a web-friendly way to enable developers to apply any number of headers to different sections of a document, add page specific watermarks, add multiple background images to the same page range, or add specific user data and time stamps to footer areas… again… all using a single call to the PDF WebAPI. The “decorationData” is, essentially, a recipie that tells the WebAPI how to add the content you’ve described to each PDF page or range of pages in your document.
Also, unlike other tools, the “decorationData” format has the concept of facing pages. Instead of each page having the same left and right margin, use of the Facing pages property allows developers to define an inside and outside margin so that page spreads will have their headers and footers applied properly for the left and right pages of a book or sheets in a binder… again… all while maintaining interoperability with Adobe Acrobat. Other, more cumbersome, tools require that you to deal with even and odd pages separately and in multiple steps and can cause confusion.
The Datalogics Difference:
The Datalogics PDF WebAPI DecorateDocument service was developed using the PDF Java Toolkit developed by Adobe. I’ve mentioned the fact that the output from the DecorateDocument service is interoperable with Adobe Acrobat several times earlier in this article but; why is this important? When Adobe Acrobat adds a header, footer, watermark, or background to a PDF file, it marks that content in a very specific way so that it can be easilty detected among all of the other page content and updated or removed by other libraries or viewers if necessary. In addition to marking these “decorations” as special, it also adds a small chunck of XML that is used to drive the Acrobat user interface so that end users can update an existing header, for eaxample, rather than remove the existing one and replacing it. Most other tools don’t do this. DecorateDocument does. This is the Datalogics difference; we ensure that developers get the output from our tools that not only appears visually correct, but is carefully constructed to match the output from Adobe Acrobat as closely as possible. This ensurs that your customers get the experience they expect and that the files behave properly as they move through their workflows.