pyStone
unread,Mar 29, 2012, 4:51:45 AM3/29/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to xhtm...@googlegroups.com
dataString = '''
<html>
<head>
<title>tool by pyStone</title>
</head>
<body>
<div id="big-container" style="width:2100px;background-color:#FFFFFF;">
<div id="header" style="background-color:#FFFFFF;clear:both;text-align:center;">
<h3>tool@pyStone</h3>
</div>
<div id="legend" style="background-color:#FFFFFF;clear:both;text-align:center;">
...
<div>
<div style="width:700px;background-color:#FFFFFF;float:left;"><div>
<div style="width:700px;background-color:#FFFFFF;float:left;"><div>
<div style="width:700px;background-color:#FFFFFF;float:left;"><div>
<div id="footer" style="background-color:#FFFFF0;clear:both;text-align:center;"> Hach Company</div>
</div>
</body>
</html>
'''
pisa.CreatePDF(dataString,file('filename.pdf','wb'))
You can see is a real big pdf page 2100px width. How could i defined my pdf page size?
It seems the secret hidden in here:
pisa.CreatePDF(src, dest=None, path=None, link_callback=None, debug=0, default_css=None, xhtml=False, encoding=None, xml_output=None, raise_exception=True, capacity=100*1024)
but still no clue. I got page size of 8.27 * 11.69 in every time. And the div layout comes to no layout .
Thanks.