SimpleInvoices Group Forum › Forums › Fearless359 SimpleInvoices Discussion Group › PDF rendering differs from Print
Tagged: float, PDF export, table
- This topic has 12 replies, 3 voices, and was last updated 2 months, 2 weeks ago by RRowley.
-
AuthorPosts
-
October 27, 2021 at 4:18 am #1597StuartWParticipant
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: VATA 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
October 28, 2021 at 8:48 am #1598RRowleyParticipantIt 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.
Attachments:
October 29, 2021 at 5:20 am #1601StuartWParticipantMany 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:
November 4, 2021 at 9:29 am #1603RRowleyParticipantThis 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.
November 4, 2021 at 9:48 am #1604RRowleyParticipantGot 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.
November 16, 2021 at 12:44 am #1616StuartWParticipantMany thanks
November 20, 2021 at 1:21 pm #1621ppmtParticipantI 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!
November 22, 2021 at 7:21 am #1623RRowleyParticipantI 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.
November 28, 2021 at 10:46 am #1625StuartWParticipantI 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
July 21, 2024 at 3:37 pm #2056StuartWParticipantThe 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:
July 22, 2024 at 1:26 pm #2058RRowleyParticipantYou 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.
July 23, 2024 at 11:50 pm #2059StuartWParticipantThat 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.
July 28, 2024 at 6:17 am #2060RRowleyParticipantUse the class field to assign a user defined class. The in the style.css file add that class with the style adjustments you want.
-
AuthorPosts
- You must be logged in to reply to this topic.
Recent Comments