Xportability / css-to-pdf

Convert any HTML page or region to PDF - supports CSS, SVG, embedded XML objects, and more..
http://www.cloudformatter.com/CSS2Pdf
206 stars 78 forks source link

Can't get "pdfproperties" to work #13

Closed rherring closed 8 years ago

rherring commented 8 years ago

I'm trying to setup the properties of the PDF that will be generated from my website, but no matter what information I input into this section, it doesn't show up in the generated PDF.

Specifically, the most important part I'm needing to get working, is the "UserPrivileges > Print Only" and "OwnerPassword". This is what I've placed just after the opening body tag <body> (is that the right place to put this)

<body>
    <pdfproperties style="display:none;">
        <metainfo>
            <prop name="author" value="My Company Name"></prop>
            <prop name="title" value="My Document Title"></prop>
            <prop name="subject" value="My Document Subject"></prop>
            <prop name="creator" value="Adobe PDF"></prop>
            <prop name="keywords" value="CSS, PDF"></prop>
        </metainfo>
        <pdfpreferences>
            <pref name="pdf-version" value="1.7"></pref>
            <pref name="view-mode" value="auto"></pref>
            <pref name="initial-zoom" value="fit-width"></pref>
            <pref name="page-layout" value="continuous"></pref>
            <pref name="viewer-preferences" value="display-document-title"></pref>
            <pref name="crop-offset" value="0.5in"></pref>
            <pref name="crop-mark-width" value="0"></pref>
            <pref name="ownerpassword" value="Test1234"></pref>
            <pref name="userpriviledges" value="print"></pref>
        </pdfpreferences>
    </pdfproperties>

    <!-- Page Content Goes Here -->
</body>

Thanks

kstubs commented 8 years ago

We specifically read these properties from the container that is your print section, so include these properties there. For example, if you have a div with ID = "print_me", inside this div include the pdfproperties tag.
Thanks, and let us know if that works for you!

kbrown01 commented 8 years ago

Assume issue is closed as the solution is given and no further comments made.