Page break ?

Phoca PDF - creating PDF documents in Joomla! CMS
gulp
Phoca Member
Phoca Member
Posts: 33
Joined: 09 Oct 2012, 12:45

Page break ?

Post by gulp »

Hello,
I'm sorry if I'm posting a question that has already been asked, I can't find the right topic, but I suppose you're already working on this topic:
is there a way to set a pdf page break in the joomla editor as it will result in the pdf ?

Thank you for any suggestion
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Page break ?

Post by Jan »

Hi, there is no such option, so this needs to be customized directly in the code :-(

Jan
If you find Phoca extensions useful, please support the project
gulp
Phoca Member
Phoca Member
Posts: 33
Joined: 09 Oct 2012, 12:45

Re: Page break ?

Post by gulp »

Ok, could you suggest how/where in the code to implement it ?
Is there already a function that parses the html and convert it to a special call to the tcpdf class ?
Another solution could be to "keep together" some elements: the problem is when the page breaks automatically separating a text that is describing an image and these elements results in two different pages...

Thank you for any suggestion
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Page break ?

Post by Jan »

Hi, you should add some hidden tag into the article which will be not displayed on the site but can be read by pdf feature (or use the one set in standard Joomla! article)

if the article will have this tag: <tcpdf method="AddPage" /> then the tcpdf class will make new site.


Jan
If you find Phoca extensions useful, please support the project
gulp
Phoca Member
Phoca Member
Posts: 33
Joined: 09 Oct 2012, 12:45

Re: Page break ?

Post by gulp »

Hello,
what about updating the tcpdf to get the page break works automatically ?
http://stackoverflow.com/questions/1605 ... k-in-tcpdf
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Page break ?

Post by Jan »

Hi, thank you for information, I will update it in next version.

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Page break ?

Post by Jan »

Hi, I worked on new version and tested it, this work Ok in current version even in newest version. But you need to check if your editor (e.g. tinyMCE) does not skip the tag:

Code: Select all

<br pagebreak="true">
- if BR tag is not set in tinyMCE, change it to P tag:

Code: Select all

<p pagebreak="true"></p>
- if attribute pagebreak will be cut, you need to allow it in options of tinyMCE editor:

Joomla! administration - Plugins - Plugin - Editor - TinyMCE
Extended Valid Elements Extensions: p[pagebreak]

So if you set it, then if you add the following code to your article:

Code: Select all

<p pagebreak="true"></p>
then new page will be set.

Anyway: update to newest version: https://www.phoca.cz/news/903-phoca-pdf-3-0-3-released

Jan
If you find Phoca extensions useful, please support the project
Post Reply