Using a custom set of XML tags inside your HTML, you can insert both custom metadata as well as instructions for how the PDF would be viewed in a PDF viewer application (subject of course to that application supporting those features).
You use the (optional) tag <pdfproperties>
and within that tag you
can insert <metainfo>
and <pdfpreferences>
sections as shown in the instructions below. Within the
<metainfo>
tag, you can add <prop>
tags
with @name
, @value
attribute pairs with the data you wish
to store in the PDF metadata. Anything without one of the recognized, standard PDF
names (author
, title
, subject
,
creator
, keywords
) are stored in custom metadata in
the PDF.
The <pdfpreferences>
section allows you to insert one or more
<pref>
tags with specific @name
,
@value
pairs that control the way the resulting PDF is displayed
with a viewer that supports standard PDF view attributes. The support
name
, @value
pairs are listed below and grouped into
all the available categories:
These options let you control some general information about the generated PDF.
bookmarks
- sets whether PDF bookmarks are generated or not. The default
is "false" for Cloudformatter. You can set @value
to "true" if you want
bookmarks in PDF. Note that bookmarks are only generated for interpreted
hierarchical information. All h1
elements and there following
h2
elements and so on. Skipping levels will break the sequence and
the bookmarks will not be correct.
pdf-version
- sets the PDF version number. The default is version 1.5
for Cloudformatter but you set @value
to values like "1.3", "1.4",
"1.6" or "1.7" if you wish to change the version. Be aware thar some other features
could be disabled by setting the version too low.
compress
- sets whether the PDF is compressed or not. The default is
"true" for Cloudformatter. You can set @value
to "false" if you want
uncompressed PDF.
linearize
- sets whether the PDF is linearized or not. The default is
"false" for Cloudformatter. You can set @value
to "true" if you want to
optimize a long PDF for web view.
These options let you control how the PDF when opened appears to the end user.
view-mode
- Choose from one of the following:
auto
- If there are bookmarks in the document, the bookmarks pane
is displayed. Otherwise, all auxiliary panes are hidden.show-none
- All auxiliary panes are hidden.show-bookmarks
- The bookmarks pane is displayed.show-thumbnails
- The thumbnails pane is displayed.full-screen
- The document is displayed in full screen-mode.initial-zoom
- Choose from one of the following:
auto
- Page scaling is not specified.fit
- The page is scaled to fit completely into the view port.fit-width
- The page is scaled so that its width matches the width
of the view port.fit-height
- The page is scaled so that its height matches the
height of the view port.###
or ####%
- The page is scaled by the number or
percentage specified.page-layout
- Choose from one of the following:
auto
- Uses settings of viewer application.single-page
- Displays one page at a time.continuous
- Displays pages continuously in one column.two-columns-left
- Displays pages continuously in two columns, with
odd-numbered pages to the left.two-columns-right
- Displays pages continuously in two columns,
with odd-numbered pages to the right.two-pages-left
- Displays pages in two columns, by two pages at a
time, with odd-numbered pages to the left. two-pages-right
- Displays pages in two columns, by two pages at a
time, with odd-numbered pages to the right.viewer-preferences
- A comma separated list of the following
possibilities:
hide-toolbar
- Hides the viewer application's tool bars when the
document is active.hide-menubar
- Hides the viewer application's menu bar when the
document is active.hide-window-ui
- Hides user interface elements in the document's
window (such as scroll bars and navigation controls), leaving only the
document's contents displayed.fit-window
- Resizes the document's window to fit the size of the
first displayed page.center-window
- Positions the document's window in the center of
the screen.display-document-title
- Controls whether the window's title bar
displays the document title taken from the "title" metadata field.These options allow you to specify owner and user security in the PDF output. User-level security can inject a password to be used to open the PDF, while owner-level security can control what can be done with the PDF (like printing it or copying the data from it).
userpassword
- Sets the user password that must be entered to view the
PDF. There are no options, the @value
passed is the password to be
used.
ownerpassword
- Sets the owner password that must be entered to enable
advanced processing of the PDF. There are no options, the @value
passed
is the password to be used. An ownerpassword is used to lock down certain privledges
that an owner will grant to a recipient of the PDF. Without the owner password,
recipients can be restricted from certain things. By default they are restricted
from everything, and you can then specify what additional things you allow by using
userpriviledges
.
userpriviledges
- A comma separated list of the following
possibilities:
print
- Enables printing the document. modify
- Enables editing the document. copy
- Enables copying text and images from the document to the
clipboard. annotate
- Enables adding notations to the document and changing
the field values. These allow you to specify crop marks, bleeds and registration marks to be applied to the PDF.
crop-offset
- specify offsets from the meaningful content on the page to
the edges of the physical media (/MediaBox entry in the PDF page dictionary). Its
value is a series of 1 to 4 length specifiers that set offsets from the edges of the
page area to the corresponding edges of the /MediaBox. Rules for expanding the value
are the same as for the padding property in CSS.
bleed
- specify the bleeds — an extra space around the page area into
which the contents of the page may protrude (/BleedBox entry in the PDF page
dictionary). Its value is a series of 1 to 4 length specifiers that set offsets from
the edges of the page area to the corresponding edges of the /BleedBox. Rules for
expanding the value are the same as for the padding property in CSS.
crop-mark-width
- defines line width for the crop marks, setting it to 0
disables drawing of crop marks.
bleed-mark-width
- defines line width for the bleed marks, setting it to
0 disables drawing of bleed marks.
printer-mark
- specify additional SVG images to be drawn in the offset
area surrounding the page (specified by crop-offset and bleed parameters). Printer
marks are clipped to the outside of the bleed rectangle. The @value
is
a URL to an SVG you have. This sample has two URLs (one for a colorbar and one for a
registration mark) you can also use if you like.
The following code is what is behind this page for producing the PDF. Of course, you would only see the things supported by your PDF viewer you use. If you wish to see them all in action, then use "download" and Adobe Reader to view the PDF.
Recent changes in some browsers will not treat this XML as XML. Instead it tries (incorrectly) to not close tags. For best results, be sure to use open and close tags and not a self-closing tag.
<pdfproperties style="display:none;"> <metainfo> <prop name="author" value="Xportability LLC"></prop> <prop name="title" value="Xportability Cloudformatter: Showing Custom PDF Properties"></prop> <prop name="subject" value="A Cloudformatter Document"></prop> <prop name="creator" value="css2pdf@cloudformatter.com"></prop> <prop name="keywords" value="CSS, PDF, Cloudformatter"></prop> <prop name="custom1" value="value1"></prop> <prop name="custom2" value="value2"></prop> <prop name="custom3" value="value3"></prop> <prop name="custom4" value="value4"></prop> </metainfo> <pdfpreferences> <pref name="bookmarks" value="true"></pref> <pref name="pdf-version" value="1.6"></pref> <pref name="view-mode" value="auto"></pref> <pref name="initial-zoom" value="fit-height"></pref> <pref name="page-layout" value="two-columns-left"></pref> <pref name="viewer-preferences" value="display-document-title"></pref> <pref name="crop-offset" value="0.5in"></pref> <pref name="crop-mark-width" value="1px"></pref> <pref name="printer-mark" value="http://www.cloudformatter.com/Resources/Images/registration.svg"></pref> <pref name="printer-mark" value="http://www.cloudformatter.com/Resources/Images/colorbar.svg"></pref> </pdfpreferences> </pdfproperties>
Sit sea dolor at et ipsum amet voluptua lorem clita rebum velit id sadipscing et invidunt clita ipsum. Ut at eleifend accusam sanctus vel illum. Ipsum takimata ipsum et vel voluptua amet consetetur amet quod aliquyam tincidunt erat nibh gubergren sadipscing stet clita. Tempor te consetetur odio sed takimata. Takimata at ea eirmod sed takimata amet voluptua sit sit dolores dolore esse gubergren eirmod. Dolore feugiat consectetuer tation sanctus at rebum sea et stet ipsum wisi suscipit dolore. Takimata et diam justo tempor nihil sed ipsum. Consetetur amet elit sed no eos voluptua ut lorem. Rebum diam dolor vel ipsum magna consetetur takimata erat kasd kasd duo amet sit dolor.
Sit ullamcorper dolor vel nonumy sit elitr ut magna rebum facilisi lorem sed velit takimata. Consetetur minim dolore gubergren voluptua eirmod vulputate voluptua vulputate gubergren. Erat voluptua consequat amet diam nihil nonumy magna dolores laoreet. Feugait augue est lorem consequat ipsum ipsum sea ipsum consetetur lorem. Facer duo et dolor labore elitr et et aliquyam sanctus lorem augue. Vero duo velit magna diam liber diam ut amet sanctus et lorem gubergren.
Takimata vel sea dolore. Ut gubergren diam ea. Lorem nonumy consetetur diam dolor eos. Voluptua sea vero duo sit takimata eum. Magna possim lorem clita sea ipsum vero. Est clita et lorem in lorem odio stet at magna accumsan dolores ut nonumy veniam invidunt sea sadipscing.
Duo labore vero sea clita eum sed magna diam ipsum takimata stet ad invidunt nulla amet magna diam dolores. Eirmod veniam gubergren option dolore eu sed ut at. Est duis ea est dolor et tempor sea no lorem. Et facilisi elitr. Kasd ex elit dignissim qui sadipscing magna. At ea eos vero in at luptatum invidunt sadipscing diam laoreet consetetur no nostrud. Labore nonumy takimata eos justo duo iriure elit et duo invidunt eirmod voluptua. Ea invidunt accusam eos iriure consetetur diam.
Stet et facilisis dolor dolore et et enim dignissim et elitr sit luptatum. Tempor stet sea lorem ipsum lorem diam et tempor nonumy tincidunt. Ea et eirmod sit. Sanctus nonumy et at nonumy kasd accusam quis kasd lorem ut et ipsum cum. Volutpat clita justo gubergren labore consetetur tempor at sea facer amet ipsum sed.
Veniam sed et rebum invidunt takimata takimata amet ipsum volutpat diam volutpat. Et accusam lorem gubergren est sed aliquyam lorem dolores diam amet sea duo rebum nobis et amet. Autem feugait vulputate vero accumsan amet. Sit sed ullamcorper stet. Exerci magna sadipscing erat vero eirmod lorem clita dolore sit nulla sit consequat soluta lorem vero gubergren diam invidunt. Dolore kasd aliquam kasd sit voluptua wisi kasd at est. Dignissim elitr sit in qui. Diam ipsum enim sanctus et vero dolore et exerci iriure et elitr esse labore ex et duo qui eum. Dolore duis vel facer nonumy suscipit diam lorem tempor voluptua sit rebum justo no consetetur takimata no. Ipsum ipsum et consetetur sadipscing commodo eum ex nonumy et ea justo facilisi kasd sed. Dolores duis amet vero et consequat amet sed erat et sed sea.
Diam elitr dolore sed labore sed dolor lorem soluta eirmod ipsum lorem zzril sed nonumy molestie dolor diam vero. Hendrerit duis sea ut et sanctus dolor. Lorem diam accusam dolor nonummy stet magna nonumy sea ad diam vel et stet. Stet voluptua rebum magna gubergren nonumy sed magna tempor volutpat aliquyam dolor at dolores in diam diam euismod tincidunt. Vero et adipiscing et praesent voluptua lorem amet.
Vero eirmod amet velit id. No vero tincidunt takimata. Nihil dolores rebum esse eu est est dolores ut ut takimata amet vero ut dolor stet sed ea. Nonumy ea sadipscing ut kasd sea facilisi tempor elitr dolore dolor cum dolor duo illum autem amet ad voluptua. Accusam quis sed duis et et nonumy odio ex augue augue dolores gubergren in dolores.
Sanctus lorem sed accusam justo stet labore diam clita gubergren dolore. Nostrud sed diam justo elitr stet amet molestie clita takimata amet. Dolor amet at tempor aliquyam no nonumy wisi elitr diam accusam quis diam ut ut zzril at laoreet ipsum. Takimata magna consetetur et dolore lorem. Eum eos est consetetur accusam. No et duo ipsum aliquyam dolor lorem accusam eirmod wisi aliquam diam duo sed nibh sed nulla no nonumy. Nonumy clita velit takimata augue est magna.
Imperdiet eirmod dolor amet ut ipsum ea ut aliquyam autem et amet. Sea luptatum in eirmod. Sea gubergren blandit quis amet. Dolores et dolor ipsum exerci velit dolor dolores sit rebum consequat nibh iusto sed magna eos kasd. Labore erat eirmod ullamcorper diam est nonumy ipsum.
Vero eleifend et invidunt elitr in sit sit diam dolores et. Lorem vero est hendrerit et vero et kasd aliquip. Et elitr sea vel est kasd aliquip elitr nostrud. Dolore lorem in nonummy lorem consectetuer sit amet iriure elit eirmod. Ipsum vero at exerci aliquip dolor labore zzril diam magna eirmod nonumy labore minim no voluptua. Possim duo magna nulla. Sadipscing lorem magna sadipscing duis lorem suscipit voluptua sit et lorem et nonumy enim consetetur ea. Ex at no tempor dolores ea eos et at elitr sea takimata sanctus. Sit amet feugait justo euismod feugiat no lorem stet elitr amet minim duo ut clita nonummy voluptua.
Kasd zzril takimata enim sed elitr ut laoreet stet accumsan. Ex ipsum feugiat no dolor et stet eos blandit tempor invidunt tempor. Blandit velit magna dolor diam dolores ut et diam ut amet illum dolor duo. Tempor sanctus ipsum sit no. Feugait ad tempor sadipscing et sed ea sed dolor ex vero amet eu. Eos possim laoreet. Amet sadipscing eum vero dolores amet sit et lorem id sanctus clita ut. Aliquyam diam consetetur et duo tempor et iriure sit eirmod vel eu accusam dolore ea ipsum enim molestie. Amet sit dolore iusto ut rebum erat dolor diam ipsum possim et dolor aliquam. Ipsum ut et soluta. Illum et erat voluptua suscipit diam invidunt duis gubergren diam sit aliquyam dolor diam blandit.
Nonumy no takimata eum diam ea eum clita et clita magna eirmod eirmod diam rebum kasd ut qui. Aliquip accusam ipsum elitr nostrud gubergren tempor delenit ut nostrud possim sea et sadipscing labore ipsum. Imperdiet at in labore at stet. Zzril eirmod euismod vulputate rebum nam justo vel vero ut nulla. Takimata adipiscing clita ipsum ipsum commodo. Accusam dolor est ea erat cum duo eleifend labore tempor gubergren amet facilisis voluptua iusto. Vulputate cum kasd et quis sed justo et eirmod. Voluptua takimata stet ut elitr placerat duo et te lorem dolor iriure et tempor sit. Qui ipsum zzril dolor et sit soluta sea odio et accusam dolores augue aliquyam diam et dolore at nonummy. Vulputate ea sit lorem dolore ullamcorper ea velit dolore kasd vero erat labore suscipit. Accusam aliquip dolore tempor in laoreet sanctus feugiat.
Ut tempor nulla no esse kasd est. Ex ipsum assum dolor stet ipsum dolor vel erat voluptua accusam. Te amet est tempor justo nonumy et. Labore nonumy vel soluta molestie. Dolor eos et nulla consetetur est. Consectetuer ea et labore. Aliquyam sed veniam. Feugait erat et dolore gubergren vulputate magna diam diam duo nulla ut in aliquyam lorem ut ipsum aliquyam at. Et lorem magna labore sea at kasd et no lorem amet tincidunt no voluptua magna cum sea vero in. Sea ea et gubergren consequat lorem elitr eirmod. Lorem ipsum no ipsum eum te dolor dolor sed accumsan ea ipsum illum sit sed et ipsum sea dolore.
Feugait vero esse duo gubergren eleifend dolor et tempor et et. Ea kasd consetetur sed dignissim elit duo lobortis liber. Amet takimata sadipscing te dignissim ut dolore quod dolor elitr eirmod aliquam eos. Accusam invidunt dolor kasd ipsum voluptua. Invidunt velit et ad invidunt sit sadipscing sit sed duo magna clita no at amet eum amet amet takimata. Clita et nostrud esse magna liber sit justo molestie in invidunt sit. Ea consectetuer accusam blandit erat qui eirmod duo elitr.
Takimata nam ea facilisi. Exerci molestie ea sit wisi tation. Voluptua takimata invidunt congue. Eos et ut amet stet sit sadipscing te sed. Et amet sit clita. Eos illum nonummy nulla dolor ipsum ea eos diam at est ea dolor odio consetetur sadipscing tation. Duo amet no labore nulla amet nonumy accusam magna amet sit ut lorem diam lobortis tincidunt tempor gubergren eu. Sea erat no consetetur consetetur et eros tempor. Nonumy illum eleifend eu diam labore amet gubergren nonumy et consequat in et feugait lorem. Hendrerit accusam sed at ea adipiscing cum dolore dolore rebum nonumy invidunt kasd justo dolore velit dolor magna elitr.
Tempor delenit iriure dignissim facilisis lorem in gubergren diam odio diam est et stet ipsum delenit. At invidunt dolore nonumy duis takimata amet consectetuer ad. Gubergren dolor velit possim duo sed tempor liber in est. Justo vel rebum sed. Consetetur qui ipsum amet dolor stet molestie. Lorem dolor augue aliquyam feugait vero consequat et ut adipiscing et clita molestie. Et gubergren ut luptatum voluptua sed illum dolore aliquam duo nonummy qui dolore consetetur ut ipsum.
Consetetur gubergren ipsum luptatum delenit et sit dolores sea sit ut lorem dolores sea. Sed zzril accusam diam clita suscipit feugiat hendrerit dolores rebum iriure sit est elitr ipsum et dolore ipsum lorem. Nostrud sit justo dolor vero qui no justo dolore in blandit dolor aliquam augue est euismod rebum sadipscing dolor. Ea esse dolore dolor lorem elitr. In est dolore invidunt sanctus dolores magna clita te kasd et dolores eleifend sit no dolore id. Vel kasd sadipscing tempor sadipscing takimata vulputate vel at amet. Aliquam et elitr dolor augue zzril enim amet eirmod ad duo facilisi et nonumy dolor et. Nonummy quis facilisi eos vero tempor.
Ipsum sed illum at duis lorem eros dignissim amet voluptua facer eirmod magna tempor rebum augue. At dolor voluptua lorem takimata no sed ut aliquyam diam sed assum. Sit labore dolore est delenit eum et at in no hendrerit tempor invidunt justo. No diam nulla et sed dolore ea. Nisl diam elitr ipsum at sed ut. Ipsum et sit stet tation amet id elitr accusam elit eirmod option elitr dolores dolores. Nonumy stet in ipsum ea erat kasd sea erat erat.
Eos amet eros et consetetur sed nibh accusam eos est diam exerci dolor dolores. Zzril sadipscing ut sadipscing invidunt no aliquip sea diam et stet amet amet velit tempor. Voluptua accusam amet justo dolor et lorem aliquyam ea. Aliquyam et ut diam ut vel aliquyam justo. Et amet in in et.
Ipsum ipsum aliquyam sed consetetur dolore invidunt laoreet rebum in dolor gubergren ea kasd nisl sit sed. Consequat accusam takimata aliquam erat euismod et eu consetetur et odio odio. Aliquyam eirmod dolor accusam duo nostrud tempor dolor ipsum magna erat voluptua minim enim vel. Labore amet amet tation erat et kasd aliquyam gubergren nonumy tempor sea clita. Aliquyam et tempor diam voluptua et clita diam ipsum liber in amet lorem vulputate diam consequat duis. Vero ea gubergren sed accusam sit aliquyam takimata duo tation kasd vel et sed luptatum diam vel enim dolore.
Rebum diam consetetur at rebum labore at eos tation lorem diam accumsan voluptua. Magna sea ipsum. Dolore aliquyam ipsum et. Erat diam et stet accusam et est elit zzril gubergren illum. Sed consequat volutpat eros kasd accusam ut at et ea vero sit consetetur sit. Consequat blandit ut consetetur. Dolor ipsum ea. Sit et exerci amet ut elitr et rebum quis ullamcorper dolore dolor aliquip diam tempor no.
Vel rebum dolores accusam justo ipsum eos facer kasd sit. Molestie duis et velit. Elit diam stet labore dignissim autem ipsum vero consequat ipsum clita justo. Kasd eu labore. Vero elitr labore invidunt at dolore est sed et. Et enim eos rebum eirmod no et takimata sit sit sit est ipsum et. Invidunt molestie elitr dolore nulla veniam eos dolor ut nonumy erat. Eirmod sanctus esse nulla diam esse dolor sed stet clita est takimata magna lorem nostrud vel. Suscipit sit sadipscing et eum nonumy sit sit amet euismod duis et erat.
No takimata illum. Sadipscing labore vulputate ut veniam eirmod amet takimata et labore molestie suscipit sanctus. Dolor ea et dolore dolores erat ut invidunt. Amet rebum amet sanctus labore at. Ipsum vero et diam voluptua et nulla dolores dolor sit invidunt nobis facer elit facilisis et.
Dolore sanctus ipsum placerat nonumy ipsum ipsum takimata quis rebum eirmod diam dolore sea magna ea. Stet eum dolores diam dolore illum vulputate nonumy et et ea rebum amet. Magna sadipscing nulla dolores lorem. At ut justo stet et et dolores erat justo stet vero et facilisis amet stet elitr nulla accusam sit. Elit ea dolores iriure tempor sadipscing amet imperdiet. Vel esse at sadipscing. Gubergren erat at nulla ea facilisis duo dolore hendrerit sea autem iriure eirmod accusam est nonumy duis no sit. Wisi eos duo dolor et.
Velit eirmod elit duis ipsum kasd nonumy labore duo duo augue odio sadipscing eirmod. Rebum sadipscing sit. Est sed lorem dolor ut eros gubergren sed possim eirmod sed et ea sadipscing ea nibh eos. Aliquyam consequat ipsum erat tempor eirmod. Tempor vero elitr iriure imperdiet in. At sed accusam eirmod et invidunt delenit et. Dolore lorem dolor accumsan labore et clita erat quod enim. Clita aliquam accumsan liber tempor ex no ipsum lorem labore sit sadipscing minim. Dolore at labore voluptua eum eirmod sed quis nonumy accusam wisi. Illum aliquam dolor consetetur sit. Et ut iriure ex ut labore labore dolor sanctus ea sit eos dolore sanctus soluta et facer elitr.
Sit diam dolor accusam autem sit tempor sit eos et erat gubergren eirmod amet. Sanctus et sea eros. Elitr et feugiat sed. Dolor nonumy sed. No et illum ipsum quis est sanctus dolore sadipscing et erat consequat nam sed ea. Vero dolor ea amet et dolore feugiat duis lorem gubergren. Ad sadipscing autem dolore delenit no diam dolor. Vel facilisi mazim kasd est erat lorem eirmod stet no lorem. Dolores dolor dolor et vero et dolore voluptua aliquam dolore elit eirmod dolor kasd diam dolor lobortis ea eirmod. Sed lorem eos dolor vero ipsum diam sit et quod sit at. Magna sit et in ipsum euismod voluptua sea et eos ea eos aliquyam molestie duis possim nobis lorem.
Tempor autem vero aliquyam dolore sanctus ut elitr tempor sadipscing voluptua aliquyam accusam ipsum dolores ea velit nonumy at. Erat sed exerci eu sea exerci justo ipsum dolor at. Amet ipsum nulla justo voluptua ipsum iriure elitr sadipscing vero et accusam diam. Labore dolor sea. Magna ipsum clita et voluptua sed. Sed consetetur eos suscipit aliquip amet veniam nibh te. Sed dolor sed hendrerit stet consetetur.