Forum Bugs

Svg chart to pdf preview

dineshkumar
Hi,
I have SVG chart. i have selected all the areas. i clicked print preview to pdf. i am not able to view complete svg chart. am able to view only half portion of the chart. there is no scorll bars in pdf. its showing only one page in pdf. remaining half portion of the chart is not showing in the second pdf page. paper size letter. i tried other paper size format. its not showing full chart. Screen shot is attached for reference. chart1 screen shot shows selected portion of chart. Chart2 screen shots shows the pdf preview. Am using 12.5 prince version. Awaiting for your reply.

Thanks,
Dineshkumar
  1. chart1.jpg170.4 kB
    SVG Chart selection
  2. chart2.jpg275.0 kB
    PDF Preview

Edited by dineshkumar

mikeday
Can you attach or email me (mikeday@yeslogic.com) the SVG?
dineshkumar
Hi Mike,

I have attached the SVG file in attached text file format. Could you please do the needful.
  1. Sample.txt789.1 kB
    SVG file

Edited by dineshkumar

mikeday
There are some issues with this SVG: it is not well-formed XML (some attributes are missing quotes) and there are clip-paths that are not defined. But the biggest issue is probably the lack of a viewBox attribute, which you can fix by adding this to the root element:
viewBox="0 0 2300 5400"

This will make it easier to scale correctly.
dineshkumar
Hi,
Could you tell me which attributes are missing quotes and clipaths. so i will update. i have added the mentioned viewBox="0 0 2300 5400". it does not works. but i adjusted as viewBox="0 0 3900 5400". it works. but am selected only little portion and print preview the svg. it shows like small image, shows lot of spaces at right side, bottom and has the scroll bar. we need it 100% width and 100% height. if it large portion then it showing as small size in pdf. viewbox width and height should be adjusted dynamically based on selected portion. Attached chart4 for reference.

Is it possible to adjust dynamically the viewBox coordinates? Please share some sample.
  1. chart4.jpg183.3 kB
    PDF Preview

Edited by dineshkumar

dineshkumar
Hi Mike,

Any update on this
dauwhe
You can use the W3C's markup validation service to check your SVG:

https://validator.w3.org/

It will list all the validation errors in your document.
dineshkumar
i adjusted as viewBox="0 0 3900 5400". it works. but am selected only little portion of svg and i checked in print preview. it shows like small image, shows lot of spaces at right side, bottom and has the scroll bar. we need it 100% width and 100% height. if it large portion then it showing as small size in pdf that's fine. viewbox width and height should be adjusted dynamically based on selected portion. Attached chart4 for reference(Small portion pdf preview).

is there any viewbox calculation to show as dynamically.
  1. chart4.jpg183.3 kB
    PDF Preview_Small portion
dineshkumar
Hi Mike,

Any update on this.
mikeday
It helps if you add a border around the image, to check the aspect ratio.
dineshkumar
Hi Mike

Do i need to add border for root element.
mikeday
Try adding a border on the @page, the root element, and the svg element (if the svg element is not the root element).j