Extermely small text

237 views
Skip to first unread message

Ahmed Toulan

unread,
Apr 19, 2012, 12:38:20 PM4/19/12
to xhtm...@googlegroups.com
Hi,

I am using pisa xhtml2pdf to generate some reports from Django. I also use the {% include %} for smaller section of the report (it can be considered as sub-report).

I noticed something really strange, the text from the main template is really really small, a whole word would appear as a dot. While stuff from the included template appears with correct font size.

I tried different page size and noticed that the larger the page size the larger the text gets, but it's still really small.

I also tested my rendered html from django. It's has all the rows as expected and is valid.

Can I please know why pisa is shrinking my text ? And how to work around this ?

Thanks.

Jonathan Kellenberg

unread,
Apr 30, 2012, 1:50:36 PM4/30/12
to xhtm...@googlegroups.com
Are you including your content into a table? By default xhtml2pdf will shrink table data if a single cell is two large to put on one page.

From the docs:

Long cells

Pisa is not able to split table cells that are larger than the available space. To work around it you may define what should happen in this case. The -pdf-keep-in-frame-mode can be one of: "error", "overflow", "shrink", "truncate", where "shrink" is the default value.

table {
-pdf-keep-in-frame-mode: shrink;
}

Ahmed Toulan

unread,
May 2, 2012, 10:56:17 AM5/2/12
to xhtm...@googlegroups.com
Thanks Jonathan for replying.

Yes I am rendering my data into a table.

I tried the -pdf-keep-in-frame-mode , the only mode that got me the text with the correct font size was overflow with the small drawback that all cells are printed in the same place over each other :)

The thing I cannot understand is that my data isn't large for the table cells, and the shrinking is extreme. As I said before a whole would appear a dot.

It looks like a bug to me, isn't it ?
Reply all
Reply to author
Forward
0 new messages