Page 1 of 1

Password Protect PDF Output

Posted: Tue Sep 17, 2019 9:39 pm
by antoterrence
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>

Re: Password Protect PDF Output

Posted: Wed Sep 18, 2019 2:48 pm
by Radu
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

Re: Password Protect PDF Output

Posted: Thu Oct 03, 2019 5:45 pm
by antoterrence
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.

Re: Password Protect PDF Output

Posted: Fri Oct 04, 2019 8:41 am
by Radu
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

Re: Password Protect PDF Output

Posted: Sat Dec 21, 2019 1:18 am
by shudson310
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

Re: Password Protect PDF Output

Posted: Mon Jan 06, 2020 1:22 pm
by Radu
Hi Scott,

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

Regards,
Radu

Re: Password Protect PDF Output

Posted: Tue Oct 19, 2021 11:29 am
by julien_lacour
Hello,

Starting with Oxygen 24.0, it is possible to configure security options for PDF outputs directly from Oxygen PDF Chemistry command line parameters or using DITA parameters in the DITA Map PDF - based on HTML5 & CSS transformation.

In the same way, it is possible to control the PDF Viewer behavior: from Oxygen PDF Chemistry using -oxy-pdf-viewer parameters for all XML, HTML and DITA documents.

Regards,
Julien