pdf export

Description
vstorm
Posts: 3
Joined: Thu Mar 17, 2016 4:11 pm

pdf export

Postby vstorm » Thu Mar 17, 2016 4:18 pm

I would like to know if it is possible not only to change the Header and footer of the exported pdf document but if I can also influence the formatting of the Content and how - e.g. Change the Color of heading 1 in pdf Export. Is there a sort of reference for the possible Actions in the Export XML? Thx

NickEntin
Posts: 472
Joined: Tue Oct 24, 2006 10:27 am
Location: Polarion Software GmbH, Stuttgart
Contact:

Re: pdf export

Postby NickEntin » Mon Mar 21, 2016 3:32 pm

Hi,

more comprehensive answer you can get from support, and I don't remember if there is a configuration options to change color of Heading1 in "hardcoded" PDF export.
Through XML Export - you can choose PDF:XML-FO export (Apache XML Formatted objects - you'll find tons of references in internet), where all formatting possibilities will be possible, though it would require some technical skills - XSL knowledge and of course FO markups (examples are provided with Polarion - you can select "sample-fo" template and download/update it for your needs.

Best regards,
Nick

Salmolin
Posts: 14
Joined: Mon Sep 21, 2015 5:54 am

Re: pdf export

Postby Salmolin » Wed Dec 20, 2017 11:45 am

Is there also a xsl available for exporting documents and not only work items?
Because I would like to embed other files (work item attachements) in the exported pdf document. It is already done for attachements in test cases, but it seems that this is not working properly.

Enoriel
Posts: 2
Joined: Tue Mar 19, 2019 1:12 pm

Re: pdf export

Postby Enoriel » Tue Mar 19, 2019 2:42 pm

Hi,
There is a more simple solution than XSL and XSL-FO, although less powerful because too many things are undocumented to harness its true potential.

It is possible to embed a CSS stylesheet, by abusing the document header feature, and control the styles of the titles, tables, lists and paragraphs, up to some extent.

For example, here is what I put in Administration > Document & Pages > PDF Export Configuration:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<export>
  <pdf marginBottom="30" marginLeft="30" marginRight="30" marginTop="20">
   <header>
       <![CDATA[
   <style>
h1, h2, h3, h4, h5, h6, h7
{
   page-break-after: avoid;
}
h1, h2, h3, h4
{
   font-weight: bold;
}
h1, h2
{
   font-size: larger;
}
h3, h4
{
   font-size: larger;
}
h1
{
   page-break-before: always;
   test-transform: uppercase;
}
h3
{
   text-decoration: underline;
}
p
{
   widows: 3;
   orphans: 3;
}
table.myheader, table.myheader tr, table.myheader td
{
   border:1px solid lightgrey;
   color:black;
}
table.myheader
{
   table-layout: fixed;
   border-collapse: collapse;
   margin-bottom:10px;
}
table.myheader td
{
   padding: 5px;
}
table.myheader td.ProjectName
{
   font-size: larger;
   font-style: italic;
   line-height: 80%;
}
table.myheader td.DocumentTitle
{
   font-size: larger;
   font-style: italic;
   font-weight: bold;
   line-height: 80%;
}
   </style>
   <table class="myheader" width="100%">
      <tr>
         <td rowspan="2"><img height="50" src="http://mycompany.com/logo.png"></td>
         <td rowspan="2" width="30%" class="ProjectName">$[projectName]</td>
         
         <td>Ref:</td>
         <td colspan="3">$[cmID]</td>
      </tr>
      <tr>
         <td>Issue:</td>
         <td>$[version]</td>
         <td>Date:</td>
         <td>$[generated]</td>
      </tr>      
      <tr>
         <td colspan="2" class="DocumentTitle">$[documentTitle]</td>
         <td>SVN:</td>
         <td>$[revision]</td>
         <td>Page:</td>
         <td>$[page]/$[total]</td>
      </tr>
   </table>
      ]]>
   </header>
   <footer height="0">
      <![CDATA[

      ]]>
   </footer>
  </pdf>
</export>


Not only do I define a header table, but also a CSS stylesheet that apply to each page of the entire document !

It works quite well, but not completely : I have been able to control the color and size of titles, paragraphs, bullet lists, but have been unable to control interline spacing between paragraph, I don't know why.

Also, whether Polarion emits classes or named divs or not is undocumented, which annihilates possibilities to customize Work Item blocks, titles, description, etc.

We would need to get hand on the intermediate HTML used to generate the PDF to know that, but it does not seem possible (moreover I do not have admin access to my Polarion server).

Unfortunately I have been unable to find answers in order to go further.
If anyone has already used this approach, and succeeded in customizing the look of Work Items output, I would be highly interested.

Regards,


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 14 guests