SVG graph appears incorrectly when saved as PDF

  • 10 November 2019
  • 3 replies
  • 46 views

Badge +1

We have a SVG doughnut chart. It appears properly on runtime and even on the PDF generated via the chrome print settings. however if i try to generate the PDF with the K2 Save as PDF control, it appears incorrectly.

has anyone encountered this issue, how can this be fixed? Please view the image attached. Here is the HTML code for the SVG Doughnut

 

<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 *personal details removed*" class="donut"> <circle class="donut-hole" cx="21" cy="21" r="15.91549430918954" fill="#fff"></circle> <circle class="donut-ring" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#377bbc" stroke-width="3"></circle> <circle class="donut-segment" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="*personal details removed*" stroke-dashoffset="25"></circle> <circle class="donut-segment" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="7 93 " stroke-dashoffset="115"></circle> <g class="chart-text"> <text x="50%" y="47%" class="chart-number"> 99 </text> <text x="50%" y="55%" class="chart-label">Closed</text> </g></svg>

 

 

 

14897i02C72F6CC8991E7E.png


3 replies

I am not 100% sure on how K2 save to PDF control works, but the common approach to these things is that the browser settings of server is used for genereting PDF:s. 

Reason for this being that the result of the PDF should not differ with the users settings.

 

An easy test could be to check how the page look if you open it on the K2 server with it standard browser and settings.

 

Good Luck

/Björn

Badge +7

Hey  @anitajoseph ,

 

I have found some great resources for you to utilise.

 

(1). Intermittent behavior where PDF is rendered incorrectly

https://help.k2.com/support-services/kbt131794

 

(2). Hotfix: Images loading from a SmartObject in an    Attachment control do not reflect in a PDF file

https://help.k2.com/kb001861

 

(3). Intermittent behavior where PDF is rendered incorrectly

https://help.k2.com/support-services/kbt131794

 

(4). Hotfix: Generating a PDF with a K2 Workflow renders the PDF incorrectly

https://help.k2.com/kb003058

 

Enjoy

 

 

 

 

 

 

 

Hi Anita


Would you share , how the svg was included in the form / view run time ?


I would like to use the SVG in K2 forms but not finding way through 


thanks in advance and Br 

Reply