Forum How do I...?

Urgent: Shrink content to fit doesn't work?

asaaki
I have an HTML page with content that takes up 600px by 348px, but I want the output to be in a PDF with dimensions 9.5cm x 5.5cm (business card size).

(1) If I use this:
@page{ size: 600px 348px; margin: 0mm; }

then Prince outputs the full content, but the final PDF output is (naturally) 600px x 348px - and the document size needs to be manually changed to card size in Adobe Photoshop or something.

(2)If I use this:
@page{ size: 95mm 55mm; margin: 0mm; }

or this:
@page {  prince-shrink-to-fit: auto; size: 95mm 55mm; margin: 0mm; }


then PrinceXML outputs the PDF with the right physical dimensions, but the content that doesn't fit in 95mmx55mm is cut off and missing. Apparently shrink-to-fit didn't make a difference.

Isn't the prince-shrink-to-fit supposed to shrink the content so that it fits in the physical output dimensions? Or am I doing something wrong? I downloaded the latest 8.1 version for Windows, but if this trial works fine, I'll be purchasing a server version. Please help!

I've attached the output of both points, (1) and (2). (1) is the full content. In (2) you can see some content chopped off.
  1. output(1)_choppedcontent_rightsize.pdf6.8 kB
  2. output(2)_fullcontent_wrongsize.pdf6.8 kB
mikeday
This should work, I have emailed you an example file.
asaaki
Yes it worked, thanks!
I must have made some mistake somewhere else.
shawnb
I'm experiencing the same issue stated in this post. My content is SVG, and shrink to fit makes the content too small. I would expect it to take up the maximum amount of space without clipping the content.

-shawn

mikeday
Check if the SVG has a correct viewBox attribute and width/height settings, and whether there is any margin or padding on the page or containing blocks.