That would be hard to do... I'm imagining the pdf printer grabs the webpage, and doesn't know/care when the next page begins and ends. You could lock in values, but then if they don't print A4 you'll run into the size not being right :/
A hard workaround may be a recursive/looping webpage, that if there is more than one page, seperates it so it re-places the footer and header..
I'm more thinking about such stuff...
http://www.w3schools.com/css/css_ref_print.asp
or changing the pdf after creation for example with zend_pdf
agreed with aplysia, having things output to a html page is a semi-godsend, it lets you play with css and other things to make your own templates...
not sure if this will help, but you can page seperate using css apparantly:
http://www.ucl.ac.uk/is/documents/printcss/
Relevant part:
This can be used to force a page break within a document. So you might want all
Hey SuperRoach
thanks for the links
re pagebreak being picked up
- pdf should pick it up
- but we cant guarantee where page breaks should go - as in invoice may have unknown amounts of invoice items (which force a new page) adding a page break specifiy somewhere may make some invoices look funny
re Ruben - pdf from db
- making pdfs in php is not easy - but using html2pdf to grab a webpage and convert is very easy :)
Cheers
Justin
and html2pdf is great for the css styling side too ;)
Good point where a x amount of invoice items would break a page size.
A hack would be after y items (y being the amount of lines on a a4 page it takes to break a page), insert a linebreak type tag into the html.
I done a google search, and couldn't find much.
http://www.javaworld.com/javaworld/jw-04-2006/jw-0410-html.html
Is a alternative, java based and rather complex looking to install. i read through the pages however, and it appears that it lets you set header and footer margins, and all kinds of neat stuff.
This one seems a bit better:
http://www.reportlab.org/downloads.html
But I don't know anything about it.
Thanks SuperRoach,
a couple of more liks - these are php solutions
http://www.easysw.com/htmldoc/pdf-o-matic.php
http://www.phpclasses.org/browse/package/2905.html
http://www.rustyparts.com/pdf.php
http://www.digitaljunkies.ca/dompdf/
http://html2fpdf.sourceforge.net/
i had a look at the dompdf solution a while ago and it didnt convert the invoices very well
if anyones got any time feel free to check out these solution and let us know if anyone them are any good for us
Cheers
Justin
Hi guys,
first of all i would like to thank you for your great work. i am using si for almost a year now and it is simply great, keep up the good work :D
...but this multipage footer and header issue is reaaaaaaaaaallllllyyy important. why? in many countries it is mandatory thru the laws to
have certain information on every business document (like invoices). if they are missing the the invoice is invalid and that can get you into
serious trouble (costumer's accounting or in case of a review of your own accounting by the tax department...).
i think the best solution for users would be the introduction of a specific css-class that indicates the head + footer (eg
Thanks LG Andres,
if anyone wants to help out developing for Simple Invoices - fixing this would be a great start
Cheers
Justin
Hello,
I'm not sure what is the current status of this issue and I'll probably use GNUCash for my accounting/invoices, but since customizing reports in it require to learn some Scheme/Guile, I wanted to try some of the open-source invoicing apps to find one which could be used temporarily instead of GNUCash.
SI is the only app I've been familiar with and would probably already deploy it, but missing support for Postgres was an issue for me.
After some investigation I found the following post: http://www.opentech.dk/2009/09/07/implementing-an-open-source-multiuser-multiuser-invoice-system/ which lists several invoicing apps.
I've started with Bamboo Invoice - I had too many issues to install it, but when installed it looks nice.
However, the disappointment followed after I discovered that it cannot display Croatian characters (?,?,?,,) in PDF due to using non-capable dompdf lib.
I've tried the other packages, and both Siwapp & My Client Base use the same lib. :-(
Even phpBMS could not properly display required characters, which leaves SI as clear winner. ;)
So, in any case, pls. do not consider dompdf!!!
Sincerely,
Gour
thanks gour
i think converting Simple Invoices mysql to postgres would be easier than learning scheme/guile
if you want postgres support for Simple Invoices just svn checkout our development release - install Simple Invoices - then get the mysql db structure and convert it to postgres
then adjust the config/config.ini file to say your now using pdo_postgres and use Simple Invoices - when you come to an error then refer the relevant sql and write the postgres variant of it - and repeat till all of Simple Invoices is OK with Postgres
just send me your gmail username and i'll add you to the svn commit list
let me know your thoughts
cheers
justin
hello justin,
i think converting Simple Invoices mysql to postgres would be easier than learning scheme/guile
it might be, but gnucash provides more stuff.
if you want postgres support for Simple Invoices just svn checkout our development release - install Simple Invoices - then get the mysql db structure and convert it to postgres
i've tried to achieve that by converting from mysql to postgres with the help of mysql2postgres project (see http://github.com/maxlapshin/mysql2postgres), but i simply could not start SI...installer is not wanting to launch. :-(
I posted about my problem sometime ago (see http://simpleinvoices.org/forum/discussion/1095/help-with-postgresql-port-needed/#Item_1), but did not receive any reply.
Then I've become involved with GNUCash which brings database back-end in upcoming 2.4 version (I run 2.3.x trunk).
You already put me on the list sometime ago, but then I didn't have time to play with it.
For now, for the start I may use SI with mysql, but with the intention to migrate to GNUCash eventually.
Let's hope that Postgres is interesting for someone else who can help more.
Sincerely,
Gour
for footer, use:
div id="footer" style="position: fixed; bottom: -10mm; left: 0;"| FOOTER | end div
for header use:
div style="position: fixed; top: -10mm; left: 0pt;"| HEADER | end div
I found this on http://www.tufat.com/docs/html2ps/samples/headfoot.html
Thank you for this nice software, I also integrated sms functionality and it rocks!
Thanks for the help in this thread. I was able to get a footer in the generated PDF using a container div for the whole page and this CSS:
#container {
position: relative;
}
#footer {
position: fixed;
bottom: 0;
width: 100%;
}
But it doesn't display nicely in browsers. Since JavaScript is parsed by browsers, but not the PDF generator, I was able to override the CSS for rendering in browsers and emulate an A4 page:
In your template HTML:
<body>
<script type="text/javascript">document.getElementsByTagName('body')[0].className = 'js';</script>
In your CSS:
/* Emulate A4 page */
.js #container {
width: 210mm;
min-height: 297mm;
margin: 0 auto;
}
/* Anchor footer at the bottom */
.js #footer {
position: absolute;
}
It relies on JavaScript, but it works. I also spruced up the page with a CSS3 paper effect based on the ideas here:
http://nicolasgallagher.com/css-drop-shadows-without-images/
The CSS I use:
body.js{
background: #f6f6f6;
}
.js #container{
position: relative;
margin-top: 2em;
margin-bottom: 4em;
background: white;
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.05) inset;
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.05) inset;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.05) inset;
-moz-border-radius: 1px;
border-radius: 1px;
}
.js #container:before,
.js #container:after{
content: "";
position: absolute;
z-index: -2;
bottom: 15px;
left: 10px;
width: 50%;
height: 20%;
max-width: 300px;
-webkit-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.5);
box-shadow: 0 15px 10px rgba(0, 0, 0, 0.5);
-webkit-transform: rotate(-3deg);
-moz-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
transform: rotate(-3deg);
}
.js #container:after{
right: 10px;
left: auto;
-webkit-transform: rotate(3deg);
-moz-transform: rotate(3deg);
-ms-transform: rotate(3deg);
-o-transform: rotate(3deg);
transform: rotate(3deg);
}
this forum is full of information and i like this forum very much and i hope you like to share some more with others which is helpful for me and others..
thanks..