Forum How do I...?

Table cutting the pdf page

bgu
Hello,

I am trying to transform an HTML page into PDF using princeXML.
Works fine except when I put a <table> which is too big and cuts the text in the page (not horizontaly on another page but vertically, which means you cannot see the text)
This happens only when the tab is too large, is there a way to tell prince to shrink the table to fit the page ?

Thank you.
mikeday
The best option is to reduce the width of the table, eg. specify width="100%" so that it will be as wide as the page but no wider.

You can also enable page scaling, so that content will be scaled down to fit on the page:
@page {
    prince-shrink-to-fit: auto
}

However this will scale down everything, which is probably not what you want.
bgu
Hi,

I did specify the width to 100% but when the table is too big it keeps cutting the page.

I found on your documentation the css code you gave me (prince-shrink-to-fit: auto ) an its working fine, thanks a lot :)

Another problem that I have is that from html to pdf, the character '-' is beeing transform to a '?',
Would you be able to provide me with a solution ?

Thanks a lot for you time,

Regards
mikeday
What character is that, hyphen? en-dash? It should specify the Unicode codepoint in a warning message in the Prince log output.
bgu
It is the minus sign on the keyboard.

Output log says:
"Input is not proper UTF-8, indicate encoding !"

Thanks
mikeday
Strange, the minus sign should not cause problems. Are there other characters nearby, for example accented characters, curly quotes, non-ASCII characters or others that could be incorrectly encoded? (You can email me (mikeday@yeslogic.com) a sample document to see what's going on).
bananaaus
Hi Mike,

I have experienced bgu's hyphen-to-? problem.

It turned out that the offending hyphen was in a block of text that was copied and pasted from a Word document straight into a HTML template. This is the cause of the problem because even though it looks like a normal hyphen, I could not find it using my IDE's search function. Copying the offending hyphen and then pasting it into my IDE's search field showed that the hyphen is wider than the others.

I fixed this by re-typing the offending hyphen.

I hope this helps...


Cheers
bananaaus
Forgot to mention the following:

This is what I have in my HTML's document:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html ; charset=utf-8">


Re-typing the troublesome hyphen also fixed the following error:

Input is not proper UTF-8, indicate encoding!


Cheers,
mikeday
Okay, can you email me a sample document with this strange hyphen? It could be an en-dash or em-dash, or perhaps one of the other Unicode hyphen characters.
bananaaus
I don't have them anymore...sorry... :x