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.
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:
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.
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.
I tried using border in svg element style="border: solid blue thin;" or style="border: 1px solid blue thin;". not able to get the aspect ratio. in pdf preview am getting border. we donot want the border line in pdf. Could please help me on this to get view box coordinates
I have added the viewBox(0 0 1300 2200) for the SVG as mentioned in previous comments.without selecting any area of the image, am getting full image in pdf preview in single page. am selecting quarter portion of image. it works in pdf preview. if am selecting more than quarter portion. its not showing selected portion of image in pdf preview. attached screen shot reference for reference.
What exactly do you mean by PDF preview in single page? How are you converting the SVG to PDF, and what CSS are you applying to it, for example @page size and margins?
i am created the svg file as xml string (already i have attached as sample.txt) and Converting as byte array using prince.ConvertMemoryStream. am using @page { size: US-Letter portrait; margin: 7mm; } and then rendering as pdf. PDF preview in single page means that I have svg chart and its not showing full chart in pdf while croping (width as 100% and Height as 100%). its showing half of the chart. if i set viewBox values. it is shows in PDF in single page with very small size. it should cover the full page in pdf.