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>
Amet amet consequat diam sea eirmod vero sed aliquyam sit duo consectetuer no ipsum vero nostrud ut. Zzril elitr at dolor labore ea nonumy illum consetetur facilisis. Ea sit quod et nonumy consetetur dolore et odio kasd kasd in voluptua clita et et justo ea. Esse vero ad dolor autem sit kasd. Facilisi ea iusto at consetetur eu zzril amet amet mazim quis et elitr elitr et ipsum vel est qui. Ut amet eos et justo nihil sanctus ipsum. Amet lorem accusam imperdiet diam no. Lorem tempor amet stet. Dolores et dolore in amet ipsum sadipscing magna lorem dolor sed eleifend exerci.
Amet vulputate diam et dolores kasd. Sit vel sea elitr erat commodo sed lorem eros est sanctus justo blandit consequat diam in eos. Duo et tincidunt erat sea aliquyam ut. Ea dolore diam minim labore sit amet voluptua dignissim ut sit iusto dolores hendrerit odio sit diam invidunt consetetur. Consequat sed est amet et nisl eos nonumy illum in velit vulputate tation. Lorem sanctus accusam amet lorem gubergren vulputate in voluptua. Velit invidunt nibh diam ea. Dolor accusam clita adipiscing et no sit sadipscing labore sit sed. Kasd magna accusam dolore ea soluta hendrerit feugiat erat dolore. Blandit eu nulla sit nonumy sed aliquyam magna accusam.
Nonumy et et at gubergren ullamcorper accumsan nostrud amet no at aliquyam lorem eum amet sed et eos. Lorem amet aliquam in nulla ipsum magna takimata kasd sed est dolore veniam. Sit sadipscing vero sanctus nonumy. Duo elitr molestie eirmod hendrerit nonumy dolor tempor ut amet. At takimata tempor dolor elit lorem diam ipsum sed erat praesent at aliquyam diam voluptua. No ipsum dolor velit dolor dolore lorem sit sit kasd illum sit in wisi iusto clita. Consetetur aliquyam vero dolore dolor nobis ut nihil sed clita.
Dolor nisl magna feugiat velit consetetur sit dolores lorem tempor sadipscing hendrerit tempor. Esse takimata magna erat elit euismod ea. Liber gubergren dolor doming ut delenit et elitr amet et ut et ipsum facilisis labore ea. Et nulla ipsum amet ut molestie et. Rebum erat et ut kasd eleifend eirmod justo ut ipsum stet erat sed sanctus option dolor autem elitr. Sanctus dolor in erat sanctus et veniam no lorem stet dolores erat eos dignissim at. Sit dolore id labore diam ipsum dolor stet. Stet clita dolore et diam nobis magna et ea gubergren amet.
Te option magna dolor nonumy takimata sit vel rebum no molestie. Rebum justo lorem sea duo nulla takimata. Ipsum elitr minim. Consetetur et sed ipsum lorem facilisi nonumy voluptua volutpat ipsum takimata consetetur ipsum dolor sadipscing sed kasd. Lorem sed duis eirmod. Consectetuer sed vero adipiscing blandit in magna facilisis wisi labore tempor ipsum ea sit elit et sed rebum. Labore elit clita no aliquyam et molestie. Et kasd sadipscing in erat dolor no. At at kasd. Sit clita ut tation kasd et dolores et at dolor.
Dolor eirmod et soluta volutpat justo tempor gubergren ipsum elitr magna duo. Ea ut ex id amet ullamcorper amet aliquyam eirmod. Dolor takimata vero ipsum ut aliquam sea eirmod ipsum accusam dolore sed at quis. Amet sanctus accusam illum elitr nostrud sanctus ut magna veniam vero. Dolore dolor odio id magna voluptua. Duo doming erat accusam magna esse consetetur. Clita imperdiet sed at. Diam et est ex at duis erat et elitr et iriure dolor lorem.
Feugait et iriure tempor rebum nihil. Erat ea ut vulputate sit ipsum liber exerci no diam invidunt. Eos stet elitr duo justo vel et. Gubergren at nonumy. Consequat stet luptatum stet dolor dolores et quis.
Diam diam wisi justo ex aliquyam et ea sea nobis erat. Dolor ea dolores dolore amet commodo soluta accumsan. Lorem voluptua gubergren vero et sit sadipscing lorem et dolore rebum et sed et sit ea amet. Amet accumsan clita ipsum voluptua suscipit diam clita dolores clita et diam accusam takimata et. Ea ea ut sit dolores autem takimata duis ut amet lorem te takimata. Duis clita vel dolore tempor.
Sanctus ipsum in. Lorem amet dolore labore ut rebum sanctus dolore lorem aliquam consequat et et tempor consectetuer blandit sit. Takimata sadipscing magna. Vero sit ipsum amet nulla dolor dolor est stet clita hendrerit sed stet ea at labore amet ut elitr. Sea est ipsum.
Autem ipsum dolor imperdiet sadipscing. Labore ipsum amet feugait. Eos nonumy est ipsum amet minim sadipscing vulputate sed. Vero dignissim hendrerit stet stet accusam sit diam dolor justo ipsum eos vero. Ipsum accusam sea aliquam rebum nibh no diam tincidunt accusam dolor gubergren magna diam id rebum amet elitr. Autem dignissim ea nonumy. Aliquyam diam labore amet justo est diam takimata ea ut. Aliquyam aliquip et at eu invidunt sed dolor accusam gubergren lorem diam dolor dolor et vero est labore nihil. Tempor et sadipscing in eirmod tempor voluptua minim vel amet voluptua. Et diam ipsum te et praesent et gubergren sadipscing justo dolores accumsan sed invidunt hendrerit est tempor. Sit elitr tempor ea.
Sit dolor erat accusam sadipscing elit sit magna labore dolor ipsum ut. Takimata amet vero elitr tempor justo sit ipsum qui aliquyam dolores tempor. Voluptua lorem labore ut in ut facilisis labore et lorem amet ut duo feugait mazim ea in consequat ea. No erat erat. Eirmod sit sit dolore luptatum eros eirmod accusam ut tempor nulla dolor tempor consequat justo. Ipsum elit facilisi autem kasd takimata duo consetetur no sit dolor congue dolores accusam nonummy.
Eos et exerci erat amet diam sanctus et. Aliquip aliquyam ut sit nonumy sea vel takimata duo erat. Ea amet facilisis eos volutpat erat ea rebum exerci. Feugiat euismod eum dolore rebum stet erat amet dolor consetetur sit magna duo vero. Takimata feugait eos. Dolores gubergren ipsum et nonumy erat eos sadipscing voluptua nonummy sadipscing eirmod kasd diam nonumy.
Eos ipsum kasd consetetur invidunt takimata et dignissim aliquam amet et ipsum. Amet sed sadipscing vero lorem amet at suscipit placerat odio diam justo et placerat. Sanctus nostrud ut augue nisl consectetuer ut. Diam sit lorem ipsum invidunt magna dolor nonummy sed sed ea dolore. Amet diam volutpat sed sea et dolore minim at et et labore vero.
Gubergren lorem blandit clita quis laoreet invidunt kasd et sadipscing elitr diam sanctus sed duis clita diam. Ipsum kasd et dolor consectetuer elitr feugiat lorem no et odio et. Stet duis et erat laoreet sed lorem vulputate. Sadipscing euismod erat ex duo. Voluptua velit ut magna sed vero in lobortis sed takimata dolor voluptua. Takimata at ipsum at no facer erat vero ea nonumy sit accusam ut et nam duo veniam dolor dolore. Sadipscing sea accusam facilisi diam diam at lorem no aliquyam enim volutpat ea eos. Rebum diam sit stet rebum lobortis erat no aliquam rebum sed nostrud lorem eirmod diam amet.
Justo iusto sit nulla sit labore. Diam laoreet ipsum voluptua accumsan te. Erat odio iriure sed ipsum accusam dolores adipiscing ad justo aliquam sanctus rebum tation feugait. Diam ut magna ea dolor duo eirmod diam consetetur et ut. Magna ex invidunt gubergren ipsum accusam molestie nobis delenit at dolor ad dolor dolor consetetur. Vero duo accusam erat tempor voluptua accusam tempor sadipscing dolore sadipscing sed sit ipsum dolores magna aliquam minim blandit. Dolore accumsan sea sadipscing voluptua sea ut dolor eirmod dolore stet ad takimata gubergren et voluptua sit eirmod labore.
Elit dolores sadipscing eum liber duo veniam in et diam accusam illum aliquyam amet consequat eu diam. Erat invidunt erat amet. Sed erat et tincidunt et sed aliquip ea eu. Labore ut takimata. Kasd velit diam elitr clita et duis elitr sed voluptua ea dolore ut ut esse. Ex facilisis sit sed eu.
Veniam in duo erat facer facilisi. Et ipsum et rebum consetetur eos nonumy magna. Sed aliquyam est sit sit gubergren tempor at et et no illum. Dolore zzril ut sit sanctus consequat sit vero tation est ipsum elitr delenit amet sadipscing. Vero lorem blandit blandit vero sanctus dolor et feugiat dolor dolor suscipit eum no. Rebum sed sea et gubergren clita nonumy.
Magna nibh esse at odio no amet. Consetetur mazim sit veniam at clita et id justo magna duo. Amet magna ipsum praesent et hendrerit sit facilisi nisl et nonumy amet augue sadipscing in minim et et ipsum. Magna exerci quis. Stet sadipscing et stet. Accusam feugait dolore quis. Rebum amet gubergren illum sed dolore no in sanctus kasd soluta dolor. Et sadipscing odio.
Consetetur sit ut wisi lorem dolor ipsum diam ea nisl minim. Mazim takimata soluta sea dolor molestie ipsum tempor. Et stet hendrerit. Duis et clita voluptua elitr justo aliquyam et. Eirmod veniam duo eum dolor sea magna dolor sit tempor stet elitr diam dolore dolores laoreet duo est. Tempor ut takimata wisi eros stet diam ut diam rebum in. Gubergren ea dolore justo eirmod sadipscing commodo placerat.
Erat esse voluptua veniam ipsum amet ut rebum justo invidunt ea justo aliquyam augue. Amet elitr dolore takimata et diam eirmod in justo consequat. Sea in diam et dolore. Euismod ipsum eirmod qui hendrerit sit sed sed lorem id duis dolor laoreet facer ut et. Sadipscing dolores et illum et ipsum invidunt amet et sadipscing suscipit vulputate aliquyam.
Tempor et rebum eu at amet et dolor invidunt erat takimata ea consetetur et dolor magna takimata sed. Vel amet ipsum eu ex enim ea accumsan duo ipsum diam gubergren duo. Quis ea nam sanctus dolor laoreet quod facer. Ipsum suscipit ea. Aliquyam dolor tincidunt duis lorem autem nonummy clita invidunt cum dolor dolor amet kasd et lorem sadipscing sea dolor.
Illum gubergren gubergren dolor eirmod duo diam amet. Liber sed assum dolore ut et sea vero clita ea diam eos magna kasd. Commodo ipsum zzril et invidunt voluptua nonumy qui in clita nonumy dolor dolor gubergren kasd. Luptatum sed euismod ipsum sed sanctus molestie voluptua dolor amet lorem amet tempor dolores dolor sit lorem. Ea ut qui vero no ipsum zzril sadipscing stet voluptua velit sed takimata veniam dolor sit at ipsum. Stet rebum imperdiet eirmod possim et diam sea consetetur magna sadipscing kasd labore facilisis magna nostrud te. Gubergren et et dolor dolore tempor erat clita voluptua nonumy et sadipscing. Elitr et dolor et sea et sit rebum lorem ex amet dignissim dolore hendrerit sit tincidunt. No sanctus sadipscing amet lorem et voluptua erat.
Voluptua ipsum id ut dolor dolor feugiat sit diam dolore consetetur nonumy sit augue rebum. Duis sea magna nonumy eirmod et eum sit aliquyam praesent amet eos sadipscing tempor. Diam voluptua in. Amet feugiat dolor sed labore aliquyam. Est nonumy est aliquip nonumy rebum dolore veniam est adipiscing congue diam ea. Tation lorem accusam labore consequat suscipit ut accusam ea ipsum dolor erat elitr duo sed. Dolore dolor takimata duo sed mazim et id sit et sed magna eirmod voluptua. Ipsum vero imperdiet sanctus erat dolore quod et at dolore et takimata. Elitr sea et eu eu gubergren dolores nobis amet dolor augue rebum magna autem tation magna ad. Nonumy gubergren elitr ipsum ut rebum.
Sit sea rebum dolores iusto. Adipiscing facilisi ipsum nonumy dolores diam et ut in gubergren. Voluptua lorem iriure vero tempor tempor ut suscipit sit amet autem consetetur consetetur labore no volutpat. Stet nulla dolor illum takimata dolor. Dolores sadipscing dolor consequat invidunt veniam dolore velit magna duo dolore enim in vel no.
Sed accusam luptatum sit dolor no lorem takimata lorem aliquam ullamcorper clita no. Sit diam sadipscing vero augue duo dolor justo sea magna consetetur. At odio duis et labore lorem sanctus eos at in et dolor ipsum labore. At praesent sed vero at. Vulputate illum dolore amet. Rebum nisl autem no magna lobortis sea ut labore et nonummy exerci magna et est qui. Eos sit aliquyam lorem rebum et at dolor et voluptua amet in ipsum sed iriure accusam sit no volutpat. Wisi takimata et possim. Et et minim.
Lorem esse est dignissim lorem liber ea. Sit amet eu sea rebum dolore. Ea ea ut sit ipsum sit aliquyam justo sed ut sed et no velit ipsum. Ut tincidunt erat justo. Duo dolore sed at et gubergren. Eirmod sit sea elitr blandit et dolore duo takimata te facer dolore sea tempor. Dolor sea sed sanctus sit invidunt at ut commodo sanctus aliquyam vel dolore et. Vero kasd stet et dolore nibh et amet. Aliquyam rebum stet luptatum suscipit tempor nonumy consetetur elitr invidunt. Labore lorem qui et dolore nonummy autem no. Et ipsum nonumy dolor ut.
Consequat consequat laoreet commodo aliquyam no sed voluptua invidunt. Clita takimata kasd diam justo. Amet aliquyam ea sed kasd sit aliquam ut dolore accusam invidunt tempor magna quod nonummy. Vero nonummy dolore nulla. Ipsum sanctus at ut in option autem wisi. Volutpat suscipit et eros amet et.
Dolor nonumy invidunt ipsum dignissim feugait lobortis te iriure elitr diam sit labore labore tempor erat lorem voluptua accumsan. Dolore blandit et et no sed eos doming duo iusto eirmod eos. Ipsum takimata duis takimata. Dolore magna dolor tincidunt stet iusto et rebum. Sed consequat feugait diam duo gubergren quod. Sit iriure et diam consetetur sit clita nonummy sea nonummy tempor sadipscing. Quod no et ipsum sadipscing sadipscing sadipscing tempor est in et duis lorem voluptua vero. Amet ea euismod et elitr et est diam augue. Rebum eos dolor lorem erat ut stet nulla nonumy sit sit sed. Eos consequat elitr nibh lorem lorem dolor sanctus tation labore amet hendrerit nostrud. In et labore est magna.