Suitecrm: <pagebreak /> disapear after saving PDF template

Created on 21 Oct 2017  路  15Comments  路  Source: salesagility/SuiteCRM

Issue

< pagebreak /> is a function of the PDF template and it doesn t work

Expected Behavior

< pagebreak /> should do a page break

Actual Behavior

When I use < pagebreak /> in a PDF template document
When I edit it again , it has not been recorded.
Everything else seams to be recorded.

Possible Fix

Reverte to 7.8.7 where it was working ?

Steps to Reproduce

1)Edit a template
2)use < pagebreak /> and save (under google chrome OR firefox )
3)save
4)edit the template : page brake is not in the code of the page
5) "print quote" you get a PDF without page breaks

Context

a page break

Your Environment

Ubuntu 16.04
apache 2.4
firefox and chrome
suitecrm 7.8.8

PS: sorry for the previous confusing bug the < pagebreak /> are interpreted and deleted by github ! MAybe the same bug :)

Important Fix Proposed Bug

All 15 comments

There's a work around in the forum thread.

I don't know if it's suitable to be used as a definitive fix...

Cannot reproduce in version 7.8.x, inserting page breaks in a PDF Template appears to work fine in both Chrome and Firefox.

Tested on 7.8.18; it now works perfectely

Tested on 7.10.14: in PDF Templates is not working. When you insert a pagebreak in a template, after do the save action, the label is removed.

More info: https://suitecrm.com/suitecrm/forum/installation-upgrade-help/16286-pdf-template-pagebreak-disapearing-after-upgrade-to-7-8-8

Tested on 7.11.8 : When saved the Pagebreak then disappears after re-editing the record and doesn't take effect.

Please fix this issue.

i consider this a high priority, without pagebreaks ALL of our PDF's are poorly formatted, which means we cannot output from suitecrm directly to customers.

Could you all please test my PR? Remember to remove any file from custom/AOS_PDF_Templates/views/view.edit.php if you have one.

unfortunately the span tag does not work for me. When the PDFtemplate is saved the span tags are removed, in the same way pagebreak was.

The div tag is working fine, but i have to have a 脗 within the tags, otherwise a question mark shows up?

It's possible that the span is removed by some security cleanup code, but I will check this further. I can also change it to a div, no problem.

Why a ? Where did you get that idea from? And does the appear on the quote?

I wish i knew. I had not originally included the 脗 - i only had a space between the div tags and it worked fine. However when i went back to try the span tag (using different machine/editor) i noticed the 脗 had appeared. I think it must be down to using different text editors or something, or html encoding issues as discussed here.....https://stackoverflow.com/questions/1461907/html-encoding-issues-%C3%82-character-showing-up-instead-of-nbsp.

The 脗 does not show up in the quote, but if remove it a question mark shows up in its place.

Ill try different editors to see if i can get to the bottom of it.

Can you try these two, please?

  • pagebreak_separator : "<div style=\"page-break-before: always;\">&nbsp;</div>"

  • pagebreak_separator : "<span style=\"page-break-before: always;\">&nbsp;</span>"

div works fine, but span does not - its getting stripped out somehow.

@bunglex I don鈥檛 think span tags support html child nodes of any kind in modern browsers, including html entities. This could cause the html parser to throw an error and omit the span tag. Potentially try the escaped Unicode reference for a non-breaking space \u00A0 Or a literal space instead of &nbsp;. If that fails it鈥檚 likely being stripped within Suite.

I've updated the PR. I don't see any downsides to using div so I went with it, and with the &nbsp;

Thanks to everyone for the tips, and for the testing.

Was this page helpful?
0 / 5 - 0 ratings