xoops forums

Mamba

Moderator
Posted on: 2016/7/10 14:06
Mamba
Mamba (Show more)
Moderator
Posts: 10406
Since: 2004/4/23
#21

Re: Publisher and xoops 2.5.8 tests

Quote:
Yes, I spoke of the need to warn users to install the TCPDF for XOOPS framework.
This framework from Cedric, not the link to the github tcpdf that is not dedicated to xoops.

Yes, that's not a problem, we'll provide instructions for both:
a) for Cedric's library because is small and is customized for XOOPS
b) for the original TCPDF library with the instructions to download it using Composer, by adding the code:
"tecnickcom/tcpdf":"6.*"


How is the testing going? Is everything working?
Support XOOPS => DONATE
Use 2.5.9 | Docs | Modules | Bugs

Cesagonchu

Moderator
Posted on: 2016/7/11 8:02
Cesagonchu
Cesagonchu (Show more)
Moderator
Posts: 857
Since: 2010/2/1 2
#22

Re: Publisher and xoops 2.5.8 tests

Found another problem:
https://github.com/XoopsModules25x/publisher/issues

Mamba

Moderator
Posted on: 2016/7/11 13:19
Mamba
Mamba (Show more)
Moderator
Posts: 10406
Since: 2004/4/23
#23

Re: Publisher and xoops 2.5.8 tests

The "wrong url into preferences" has been fixed.

For the "Search", you have to set the permissions correctly, even for you as the Webmaster
Support XOOPS => DONATE
Use 2.5.9 | Docs | Modules | Bugs

SMEDrieben

Not too shy to talk
Posted on: 2016/8/9 19:10
SMEDrieben
SMEDrieben (Show more)
Not too shy to talk
Posts: 148
Since: 2009/6/17
#24

Re: Publisher and xoops 2.5.8, and tcpdf

I tried the tcpdf version of Cedric in 2.5.8 and publisher 1.03 Final: it doesn't work. The full (16 MB) does work, but has two problems:

- it is very, very slow
- Xoops codes (e.g. [b]. [i]) are ignored and shown in the pdf, line breaks are ingnored.

Looking into the makepdf.php, it appears to me that the "$myts->undoHtmlSpecialChars" is meant to interpret the xoops codes.

If I use my old tcpdf version (4.1, from 2008) with the news module, Xoops 2.5.8 and the "$myts->undoHtmlSpecialChars", the generated pdf is excellent !!

What is the problem with makepdf, $myts->undoHtmlSpecialChars and the new tcpdf version 6.2.13 ??

SMEDrieben

SMEDrieben

Not too shy to talk
Posted on: 2016/8/10 18:19
SMEDrieben
SMEDrieben (Show more)
Not too shy to talk
Posts: 148
Since: 2009/6/17
#25

Re: Publisher and xoops 2.5.8, and tcpdf

Publisher 1.03 Final and tcpdf continued

I did some additional testing and now I am fully convinced that publisher 1.03 has a bug in the pdf-generation process. Let me explain:

1. I copied the new 16 MB tcpdf version to class/libraries/vendor/tecnickcom/tcpdf
2. I changed the makepdf.php of the News-module (1.67 Final) to use this tcpdf version: it works excelllently ! All xoops-codes are interpreted correctly, all line breaks are shown in the pdf.
3. I use the makepdf.php of Publisher 1.03 and the pdf is a mess: xoops-codes are shown uninterpreted (e.g. as [b], [i] etc), lines breaks are omitted. Terrible !
4. I looked at the print.php of Publisher 1.03: this is beautiful ! Xoops-codes interpreted, lines breaks shown etc.

So, the problem of the pdf-generation in Publisher 1.03 is a consequence of the module scritps themselves. It is not due to the tcpdf.

Unfortunately I am not a programmer and I cannot solve this issue.

Thanks !

SMEDrieben

geekwright

Quite a regular
Posted on: 2016/8/17 1:52
geekwright
geekwright (Show more)
Quite a regular
Posts: 225
Since: 2010/10/15
#26

Re: Publisher and xoops 2.5.8, and tcpdf

Quote:

SMEDrieben wrote:
...
3. I use the makepdf.php of Publisher 1.03 and the pdf is a mess: xoops-codes are shown uninterpreted (e.g. as [b], [i] etc), lines breaks are omitted. Terrible !
...
So, the problem of the pdf-generation in Publisher 1.03 is a consequence of the module scritps themselves. It is not due to the tcpdf.

Unfortunately I am not a programmer and I cannot solve this issue.
...


At line 56 in makepdf.php you should see this:
$content .= $itemObj->plainMaintext();


Change that to:
$content .= $itemObj->getBody();


With this change the PDF should have all the xoopscode formatting.

Unfortunately, I can't explain why this is the way it is. There may be side effects I have not seen.

SMEDrieben

Not too shy to talk
Posted on: 2016/8/22 12:58
SMEDrieben
SMEDrieben (Show more)
Not too shy to talk
Posts: 148
Since: 2009/6/17
#27

Re: Publisher and xoops 2.5.8, and tcpdf

Sorry for the late response: I was on holiday.

This is a good solution ! Thanks ! I added an additional line after your line to remove the pagebreak-codes:

$content str_replace('[pagebreak]','',$content);


SMEDrieben

SMEDrieben

Not too shy to talk
Posted on: 2016/8/27 12:46
SMEDrieben
SMEDrieben (Show more)
Not too shy to talk
Posts: 148
Since: 2009/6/17
#28

Re: Publisher and xoops 2.5.8, and tcpdf

Similarly, if you want to show only the summary in the pdf, you can use

$content .= $myts->undoHtmlSpecialChars($itemObj->getSummary());


in makepdf.php in stead of

$content .= $myts->undoHtmlSpecialChars($itemObj->getBody());


SMEDrieben

SMEDrieben

Not too shy to talk
Posted on: 2/24 20:23
SMEDrieben
SMEDrieben (Show more)
Not too shy to talk
Posts: 148
Since: 2009/6/17
#29

Re: Publisher and xoops 2.5.8.1 and tcpdf (Xoops-Cedric package)

I'am now on 2.5.8.1 and Publisher 1.04.

The small Cedric tcpdf does not work. It generates an error:

XOOPS URL not defined


This message is defined in line 29 of the tcpdf_autoconfig.php of the Cedric package.

How can I get it working ?

SMEDrieben

SMEDrieben

Not too shy to talk
Posted on: 2/25 13:17
SMEDrieben
SMEDrieben (Show more)
Not too shy to talk
Posts: 148
Since: 2009/6/17
#30

Re: Publisher and xoops 2.5.8.1: category description

In the category description field of categories, html codes cannot be entered. They are even stored in the database !

It would be pleasant to have some possibilities to influence text layout in this area.

SMEDrieben