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 »

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: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Password Protect PDF Output

Post 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
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 »

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: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Password Protect PDF Output

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
shudson310
Posts: 156
Joined: Sat Feb 26, 2005 12:09 am
Location: USA
Contact:

Re: Password Protect PDF Output

Post 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
Scott Hudson
Staff Content Engineer
Site: docs.servicenow.com
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Password Protect PDF Output

Post by Radu »

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
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: Password Protect PDF Output

Post 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
Post Reply