سؤال

I have an ImageSVG that I want to make 100% of the PDF area. The SVG's aspect ratio is exactly the same as a Letter sized page.

I've created the Letter sized page in TCPDF but I just can't get the SVG to scale to 100% of the width and height. It seems to go to about 85% or so.

I have this for the ImageSVG Code:

$this->pdf->ImageSVG("@$svg", 0, 0 );

Does anyone have any ideas? I've tried setting all margins to 0, including the page's footer. Still no joy.

Thanks in advance. Henry

هل كانت مفيدة؟

المحلول

Try turning off the page break margin for, at least, that page:

$pdf->SetAutoPageBreak(TRUE, 0);

This will remove the margin at the bottom the image otherwise would not scale over, regardless if the bottom margin had been set to 0. Now it should scale it to the entire page automatically, or scale it by using the variables in the ImageSVG() function.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top