Password Protect PDF Output

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
antoterrence
Posts: 30
Joined: Sat May 04, 2019 5:55 pm

Password Protect PDF Output

Post by antoterrence » Tue Sep 17, 2019 9:39 pm

Is there an option to encrypt PDF when PDF transform is run?

Code: Select all

<renderer mime="application/pdf">
    <encryption-params>
        <user-password>testuserpass</user-password>
        <owner-password>testownerpass</owner-password>
        <noprint/>
        <nocopy/>
        <noedit/>
        <noannotations/>
        <encryption-length>128</encryption-length>
        <encrypt-metadata>false</encrypt-metadata>
    </encryption-params>
</renderer>

Radu
Posts: 6812
Joined: Fri Jul 09, 2004 5:18 pm

Re: Password Protect PDF Output

Post by Radu » Wed Sep 18, 2019 2:48 pm

Hi,

If you are producing the PDF from Oxygen using our DITA to PDF using CSS transformation scenario, in the Oxygen installation folder you can create a subfolder called "config" inside which you can create an XML document called "chemistry-fop.xconf".

The contents of that XML document should be something like:

Code: Select all

<fop version="1.0">

  <!-- Strict user configuration -->
  <strict-configuration>true</strict-configuration>

  <!-- No strict FO validation, putting border and padding on the page is allowed.-->
  <strict-validation>false</strict-validation>

  <!-- Base URL for resolving relative URLs -->
  <base>./</base>

  <!-- Font Base URL for resolving relative font URLs -->
  <font-base>./config/fonts</font-base>

  <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 96. 
     If you change it, use just the number, like 72, without the "dpi" units.
  -->
  <source-resolution>${PARAM_IMAGE_RESOLUTION_DPI}</source-resolution>

  <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, FOP default: 96.
  	   Using a larger value in Chemistry to improve the rastered sections from the SVG.
       If you change it, use just the number, like 72, without the "dpi" units.
  -->
  <target-resolution>600</target-resolution>

  <!-- Turn on basic accessibility. -->
  <accessibility>true</accessibility>

  <renderers>

    <renderer mime="application/pdf">
    <encryption-params>
        <user-password>testuserpass</user-password>
        <owner-password>testownerpass</owner-password>
        <noprint/>
        <nocopy/>
        <noedit/>
        <noannotations/>
        <encryption-length>128</encryption-length>
        <encrypt-metadata>false</encrypt-metadata>
    </encryption-params>
      <!--
        To score better at the accessibility support, your PDFs should be in the PDF/UA-1 
        mode. This ensure 508 complience. See documentation, accessibilty section for details.
      -->
      ${PARAM_ENABLE_PDF_UA_MODE}
      
      <fonts> 
        ${PARAM_FONT_TRIPLETS} 
        
        <!-- register all the fonts found in a directory and all of its sub directories -->         
        ${PARAM_FONTS_DIR} 
        
        <!-- automatically detect operating system installed fonts, but also solves references between the font files. -->
        <auto-detect/>
      </fonts>
    </renderer>
  </renderers>

  <!-- A substitution can map a font family to another. -->
  <fonts>
    <substitutions> ${PARAM_FONT_SUBSTITUTIONS} </substitutions>
  </fonts>


</fop>
We'll work on our side to maybe add some documentation about how this can be done and maybe also make the process simpler.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

antoterrence
Posts: 30
Joined: Sat May 04, 2019 5:55 pm

Re: Password Protect PDF Output

Post by antoterrence » Thu Oct 03, 2019 5:45 pm

Radu wrote:
Wed Sep 18, 2019 2:48 pm
Hi,

If you are producing the PDF from Oxygen using our DITA to PDF using CSS transformation scenario, in the Oxygen installation folder you can create a subfolder called "config" inside which you can create an XML document called "chemistry-fop.xconf".

The contents of that XML document should be something like:

Code: Select all

<fop version="1.0">

  <!-- Strict user configuration -->
  <strict-configuration>true</strict-configuration>

  <!-- No strict FO validation, putting border and padding on the page is allowed.-->
  <strict-validation>false</strict-validation>

  <!-- Base URL for resolving relative URLs -->
  <base>./</base>

  <!-- Font Base URL for resolving relative font URLs -->
  <font-base>./config/fonts</font-base>

  <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 96. 
     If you change it, use just the number, like 72, without the "dpi" units.
  -->
  <source-resolution>${PARAM_IMAGE_RESOLUTION_DPI}</source-resolution>

  <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, FOP default: 96.
  	   Using a larger value in Chemistry to improve the rastered sections from the SVG.
       If you change it, use just the number, like 72, without the "dpi" units.
  -->
  <target-resolution>600</target-resolution>

  <!-- Turn on basic accessibility. -->
  <accessibility>true</accessibility>

  <renderers>

    <renderer mime="application/pdf">
    <encryption-params>
        <user-password>testuserpass</user-password>
        <owner-password>testownerpass</owner-password>
        <noprint/>
        <nocopy/>
        <noedit/>
        <noannotations/>
        <encryption-length>128</encryption-length>
        <encrypt-metadata>false</encrypt-metadata>
    </encryption-params>
      <!--
        To score better at the accessibility support, your PDFs should be in the PDF/UA-1 
        mode. This ensure 508 complience. See documentation, accessibilty section for details.
      -->
      ${PARAM_ENABLE_PDF_UA_MODE}
      
      <fonts> 
        ${PARAM_FONT_TRIPLETS} 
        
        <!-- register all the fonts found in a directory and all of its sub directories -->         
        ${PARAM_FONTS_DIR} 
        
        <!-- automatically detect operating system installed fonts, but also solves references between the font files. -->
        <auto-detect/>
      </fonts>
    </renderer>
  </renderers>

  <!-- A substitution can map a font family to another. -->
  <fonts>
    <substitutions> ${PARAM_FONT_SUBSTITUTIONS} </substitutions>
  </fonts>


</fop>
We'll work on our side to maybe add some documentation about how this can be done and maybe also make the process simpler.

Regards,
Radu
Hi,
Is there a similar solution for setting the Initial View in the PDF output.
We want to do the following:
  • set the navigation tab to Bookmarks Panel
  • Page layout to Single page continuous etc
Thank you in advance.

Radu
Posts: 6812
Joined: Fri Jul 09, 2004 5:18 pm

Re: Password Protect PDF Output

Post by Radu » Fri Oct 04, 2019 8:41 am

Hi,

Right now we do not have support for this, I added an internal issue to look into it. The FOP configuration file does not seem to support such a feature so we'll need to figure out if this can be implemented in the code.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

shudson310
Posts: 142
Joined: Sat Feb 26, 2005 12:09 am
Location: USA
Contact:

Re: Password Protect PDF Output

Post by shudson310 » Sat Dec 21, 2019 1:18 am

Is there a way to use this config inside of a custom framework? I'd like to distribute this across the team, rather than per desktop install...

Thanks,

--Scott
Radu wrote:
Wed Sep 18, 2019 2:48 pm
Hi,

If you are producing the PDF from Oxygen using our DITA to PDF using CSS transformation scenario, in the Oxygen installation folder you can create a subfolder called "config" inside which you can create an XML document called "chemistry-fop.xconf".

The contents of that XML document should be something like:

Code: Select all

<fop version="1.0">

  <!-- Strict user configuration -->
  <strict-configuration>true</strict-configuration>

  <!-- No strict FO validation, putting border and padding on the page is allowed.-->
  <strict-validation>false</strict-validation>

  <!-- Base URL for resolving relative URLs -->
  <base>./</base>

  <!-- Font Base URL for resolving relative font URLs -->
  <font-base>./config/fonts</font-base>

  <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 96. 
     If you change it, use just the number, like 72, without the "dpi" units.
  -->
  <source-resolution>${PARAM_IMAGE_RESOLUTION_DPI}</source-resolution>

  <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, FOP default: 96.
  	   Using a larger value in Chemistry to improve the rastered sections from the SVG.
       If you change it, use just the number, like 72, without the "dpi" units.
  -->
  <target-resolution>600</target-resolution>

  <!-- Turn on basic accessibility. -->
  <accessibility>true</accessibility>

  <renderers>

    <renderer mime="application/pdf">
    <encryption-params>
        <user-password>testuserpass</user-password>
        <owner-password>testownerpass</owner-password>
        <noprint/>
        <nocopy/>
        <noedit/>
        <noannotations/>
        <encryption-length>128</encryption-length>
        <encrypt-metadata>false</encrypt-metadata>
    </encryption-params>
      <!--
        To score better at the accessibility support, your PDFs should be in the PDF/UA-1 
        mode. This ensure 508 complience. See documentation, accessibilty section for details.
      -->
      ${PARAM_ENABLE_PDF_UA_MODE}
      
      <fonts> 
        ${PARAM_FONT_TRIPLETS} 
        
        <!-- register all the fonts found in a directory and all of its sub directories -->         
        ${PARAM_FONTS_DIR} 
        
        <!-- automatically detect operating system installed fonts, but also solves references between the font files. -->
        <auto-detect/>
      </fonts>
    </renderer>
  </renderers>

  <!-- A substitution can map a font family to another. -->
  <fonts>
    <substitutions> ${PARAM_FONT_SUBSTITUTIONS} </substitutions>
  </fonts>


</fop>
We'll work on our side to maybe add some documentation about how this can be done and maybe also make the process simpler.

Regards,
Radu
Scott Hudson
Content Strategist
Jeppesen
Site: jeppesen.com

Radu
Posts: 6812
Joined: Fri Jul 09, 2004 5:18 pm

Re: Password Protect PDF Output

Post by Radu » Mon Jan 06, 2020 1:22 pm

Hi Scott,

We'll update this forum thread when we come up with some kind of easier configuration for this.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply