PDF rendering differs from Print

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1597
    StuartW
    Participant

    Can any one explain how to have the pdf export looking similar to the print preview? Previously the Print review and PDF rendering were very similar. Now PDF seems to be one long column with the summary moved to the left side from the right. One alternate template (eg-invoice) is nearly correct but is missing some Labels (in the Biller section for example).

    I have downloaded and installed master_2020.zip- version 2020.3.11 update date 20211016. It has the the sample data with minimal changes to custom.config.ini viz:
    exportPdfPaperSize = A4
    localLocale = en_GB
    localCurrencyCode = GBP
    and to Si Defaults (tax = Vat and Language = Englis(h(UK) (en_GB). It shows these settings:
    Default Biller:
    Default Customer:
    Default Invoice:
    Default Invoice Preference: Invoice
    Default Invoice Template : default
    Default number of line items: 3
    Default Payment Type: Cash
    Default Tax: VAT

    A recent Debian update to openssl finally broke PDF rendering in version 2013.1.beta.8 using PHP 5.6 and a much postponed upgrade is now essential.

    Having been a very satisfied user of SI for the past decade and I have long wanted to update to Fearless359

    #1598
    RRowley
    Participant

    It looks fine to me using the settings you gave. There is a problem in the rendering of the amount fields in the first section not interpreting, £, as the British Pound sign. But otherwise, the rendering looks pretty much the same in the Export to PDF, and the Print options. I also checked the PDF attachment on the email. All looked fine. Here are the settings I used.

    In config/custom.config.ini:

    [exportWordProcessor] => doc
    [exportPdfDefaultFontSize] => 7
    [exportPdfPaperSize] => A4
    [exportPdfLeftMargin] => 15
    [exportPdfRightMargin] => 15
    [exportPdfTopMargin] => 15
    [exportPdfBottomMargin] => 15
    [versionName] => 2020.3.11
    [versionUpdateDate] => 20211016
    [localLocale] => en_GB
    [localCurrencyCode] => GBP
    [localPrecision] => 2

    In Inv Prefs:

    Currency sign: £
    Currency code: GBP
    Invoice heading: Invoice
    Invoice wording: Invoice
    Invoice detail heading: Details
    Language: en_GB
    Locale: en_GB

    I’ll work on the amount rendering issue but otherwise, looks fine to me. Make sure you are running the latest version and attach the PDF if it is still a problem. I’ve attached the PDF that I generated. The first with my standard settings and the second with your settings.

    #1601
    StuartW
    Participant

    Many thanks, yes I get something similar once I changed the Font setting from 12 to 7.

    Previously with version 2013.1.beta.8 the layout was:
    logo etc at top
    then biller details on left with summary to the right
    then customer details on left
    then notes and details below
    I have attached redacted sample.

    I guess the question should be “Is there a similar template?” or do I need to create it?

    Again many thanks for your help

    Attachments:
    #1603
    RRowley
    Participant

    This appears to be a bug in the MPDF library used to generate the PDF from HTML code. I’ve documented and reported it to the site that maintains this code. Hopefully they can find and fix it quickly but until then, I have no solution.

    #1604
    RRowley
    Participant

    Got a quick response on this issue. Turns out that floating tables is not supported in the MPDF library. That means the template has to be rewritten to merge the right float ant the left positioned tables as a single table. I’ll work on that and let you know when I have a solution.

    #1616
    StuartW
    Participant

    Many thanks

    #1621
    ppmt
    Participant

    I would be interested to see what you can do as well.

    This is basically what is stopping me from upgrading to the latest version at the moment. I tried to rewrite my template but it is just not as good as it was!

    #1623
    RRowley
    Participant

    I tried rewriting the default template to not use floats. The logic got significantly convoluted when dealing with optional fields like various phone numbers and custom fields. If you can eliminate the fields you really don’t use so the logic doesn’t have to test if the field is empty and such, then the logic should be more straight forward. Other than that, I don’t have a lot of suggestions. I did got back to the SI 2011 and 2013 libraries and I’m not sure they supported floating tables in PDF. I might try to install an old version just to test and see.

    #1625
    StuartW
    Participant

    I had been running 2013.1.beta.8 with php 5 on debian 11 (bulseye) until an openssl update got in the way. I have set up a vm running debian 8 (jessie) which has an older version of openssl which lets me run 2013.1.beta.8 with php 5 (albeit without my logo and cannot send email). That might be a useful way to install an old version. When I get time over the next few weeks I will have another attempt at the default template. Your insights will be very helpful. Thanks again

    #2056
    StuartW
    Participant

    The Customer and Biller labels for phone, mobile, fax and email in my invoice pdf are in bold. Can any one explain how to stop them appearing in bold?

    I have been running 2013.1.beta.8 with php 5 on debian 8 (jessie) as I had fixed my emailing, I finally decided I really had to upgrade and have installed version 2023.0.7 and imported my data. Since you noted that mpdf does not support float right, I amended the 2013.1.beta.8 template with tables and fudged the widths to fit an A4 page. I have attached a copy of this template. There are two differences.

    The Customer and Biller labels for phone, mobile, fax and email are appearing in bold. The other issue is that the font sizing is larger.

    Any insights would be welcomed, many thanks.

    Attachments:
    #2058
    RRowley
    Participant

    You are inheriting CSS settings from the standard CSS file (css\main.css). Use the css file in the same directory as your template to override default settings. Basically, you’ll need to change the TH settings; which are generated by the print_if_not_null function. You should be able to control font size in the same manner.

    #2059
    StuartW
    Participant

    That makes sense, but I cannot see how to overwite this. How do I modify parameters class1=” class2=” passed to the print_if_not_null function at present to do this or what should I add to the local style.css?. I tried modifying main.css to have tr.biller th,tr.customer th{font-weight:normal}, but it had no effect. It still appears in bold (and is also centered). Any ideas on where the bold is being inherited from? Is there any way of inspecting the html before it is transformed by mpdf? Sorry for my ignorance but can you possibly help me about here pleaase.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.