You can easily change some PDF options like file name or file size of the PDF list and orientation.
More options you can find in this official documentation, like https://pdfmake.github.io/docs/0.1/document-definition-object/page/ or https://pdfmake.github.io/docs/0.1/document-definition-object/document-medatadata/ (see docDefinition section)
SR.pdfOptions({ pageSize: { width: 773.86, height: 1094.46 }, pageOrientation: 'landscape', pageMargins:[50,90,30,80], info: { title:'Actonic Report Tool', author: 'john doe' }, filename: issue.key + ' - Report.pdf', }); |
In general, this is the most common option that we use.
pageSize: { width: 773.86, height: 1094.46 }, |
If you specify the correct points values, it will be like more dpi of the list.
“pageOrientation
“ - orientation of the page, can be “landscape
” or “portrait
“.
“pageMargins
” - default margins of the page, [left, top, right, bottom]
or [horizontal, vertical]
or just a number for equal margins
“info
“ section - you can provide meta for PDF, which users will see in the options, that you will see in the options of the PDF viewers.
“filename
“ - name of the exported PDF. You can manage individually, except for some system limitations, like file name should not contain more than 255 characters or special symbols, etc. (see https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-shares--directories--files--and-metadata ).
You can also provide “pdfOptions
”. It means that you can use any field of the issue, like “ issue.key + " - " + issue.fields[“customfield_12345] + ".pdf"
”
If a user has a scaling window, then he will have problems with exporting canvas elements to the PDF.
We have several solutions to this problem.
We implemented a default handler, that should help users to set width/height sizes of the block.
Example that should work:
<div style="width:500px;"> <canvas id="myChart"></canvas> </div> |
2. Also, you can use this workaround:
$("canvas").each(function(ind, el) { var ctx = el.getContext('2d') var scale = 1; // Change to 1 on retina screens to see blurry canvas. el.width = Math.floor(ctx.canvas.offsetWidth); el.height = Math.floor(ctx.canvas.offsetHeight); ctx.translate(scale, scale); ctx.restore(); }) |
scale = 1 could help to achieve better results.
Use "pdf-hidden-block"
class, like:
<div class="pdf-hidden-block">Content to be hidden</div> |