Can't produce PDF in Letter size
  • dfreydfrey March 2010

    I would like to create PDFs in Letter format (8.5x11 Inches).

    I tried modifying "config/config.ini" and changing the export.pdf.papersize setting. I tried values of "Letter", "letter", "LETTER", "US-Letter", "BROKEN_SETTING" and I got A4 sized PDFs every time. When I put "syntax:error=yes" as the setting, I got a Zend_Config_Exception, so it appears that the file is at least being parsed.

    I then noticed that there is a si_system_defaults tables in my database. That table includes a row with name "pdfpapersize" with an associated value of "A4". I tried modifying this value, but again, it seemed to have no effect.

    What do I need to do in order to generate letter sized PDFs?

    I am running the version of simpleinvoices from simpleinvoices.2010.1.zip

  • dfreydfrey March 2010

    I dug around in the code some more and I found that when I changed line 2447 of include/sql_queries.php from
    $media = Media::predefined("A4");
    to
    $media = Media::predefined($config->export->pdf->papersize);

    It now generates the correct sized PDF.

    As a side note: I found it difficult to search through the code because there is so much commented out stuff that isn't used anymore. Revision control is for keeping old code. Comments are not. If it's not used, delete it!

  • sbrsbr March 2010

    good to see u made it work, roughly 1 hour time :) well done...

  • justinjustin March 2010

    thanks dfrey- great to see you got it working

    if you want a svn account to help us delete all the old stuff - just email me your gmail username and i'll set it up

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • justinjustin March 2010

    fyi - the $media = Media::predefined($config->export->pdf->papersize); fix has been committed into svn - will be incldued in the next release

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Categories