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