Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#61 2006-02-21 01:06:43
- wanni
- Archived Plugin Author
- Registered: 2005-11-11
- Posts: 32
Re: [plugin] [ORPHAN] wan_pdf
Hi guys, this evening I had some time to spend on this plug-in and I think the solution isn’t that far away. So this is what I found out.
1. The textile-thing: It was just what I guessed. If a non-valid XHTML-file is produced, xhtml2pdf stops its output. So every text has to be between < p> and < /p> tags. My suggestion: check if excerpt and body start with < p> and end with < /p>, if not, add these tags. This is the pragmatic way to do so, does anyone have a better solution?
2. The unicode-issue: I spent some time reading on fpdf.org and I unfortunately I had to read, that fpdf does not support UTF-8-encoding. But there is a solution. Someone deveoped an exension for fpdf called updf and guess what the “u” stands for: you’re right, for unicode. The first tests were successful.
Still to do:
1. Check the image-issue
2. Check the trouble with the PHP-version, but I still can’t reproduce this. It works both on my local installation with PHP 5 and on my website with PHP 4. But perhaps this problem disappears when the textile-problem is fixed.
So stay tuned, there will be a (hopefully everywhere working) version.
Offline
#62 2006-02-23 05:43:46
- Dawk
- Member
- Registered: 2005-02-22
- Posts: 74
Re: [plugin] [ORPHAN] wan_pdf
sounds great, have been wanting to try this out.
subscribed
Offline
#63 2006-02-23 10:17:43
- wanni
- Archived Plugin Author
- Registered: 2005-11-11
- Posts: 32
Re: [plugin] [ORPHAN] wan_pdf
I just released an updated version, changelog is in the first post of this thread. I would be very happy, if my hard-working beta-testers could do some tests once again. Please post any suggestions and bug reports in this thread. Oh, and one remark: UTF8 sucks ;)
Offline
#64 2006-02-24 21:04:52
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] wan_pdf
I deleted all old pdf files, installed v 0.3 and ftp’ed the new xhtml2pdf folder to textpattern/lib/. Unfortunately when I want to open a page with an article with an image in it, I still get this error:
FPDF error: Missing or incorrect image file: /home/virtual/site87/fst/var/www/html/casadonamaria/textpattern/lib/xhtml2pdfb835684a95caf4231ef6f165d7e5c179_tmp.jpg
(shouldn’t there be a slash after /lib/xhtml2pdf?)
Also there is still a “1” between the article title and the body in some pdf files, and not in others.
I added debug=“y” but what should it do exactly? I don’t see anything different.
EDIT: I get the FPDF error even when I set the articles with images to use another article form, that does not contain the wan_pdf tag…
Last edited by doggiez (2006-02-24 21:13:36)
Offline
#65 2006-02-24 21:14:21
- wanni
- Archived Plugin Author
- Registered: 2005-11-11
- Posts: 32
Re: [plugin] [ORPHAN] wan_pdf
Very strange. The only thing that debug=“y” does, is that the temporary xhtml-files are not deleted. Perhaps you could do two things. Post the image url exactly as it is in the source code. And send the temp xhtml-files to martin@wannert.net and I will have a look at it. Thanks for you feedback.
EDIT: I think there should be a slash, but I don’t know why this strange image-url is created at all.
EDIT2: That is very strange, something seems to be included what should not be included
Last edited by wanni (2006-02-24 21:17:06)
Offline
#66 2006-02-24 21:23:05
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] wan_pdf
The url of the images in the source is like this:
<img src="http://casadonamaria.portugalore.com/images/2.jpg" height="338" width="500" alt="" />
Where should those temp files be? I don’t see any.
Offline
#67 2006-02-24 21:40:48
- wanni
- Archived Plugin Author
- Registered: 2005-11-11
- Posts: 32
Re: [plugin] [ORPHAN] wan_pdf
The temp files are located usually in path_to_textpattern/textpattern/tmp. You can see the location in the admin panel under preferences/advanced preferences
Offline
#68 2006-02-24 23:06:54
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] wan_pdf
I noticed that the temp html files are created, with images. So I checked my pages with those articles for validation errors, and indeed found two :( But fixing them unfortunately did not make a difference…
Offline
#69 2006-02-26 09:44:15
- wanni
- Archived Plugin Author
- Registered: 2005-11-11
- Posts: 32
Re: [plugin] [ORPHAN] wan_pdf
Of course you have to produce valid xhtml. But please send me the temp file where images are not working and I will have a look at it and perhaps I can fix the bug.
Offline
#70 2006-02-26 11:31:30
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] wan_pdf
Thanks, I mailed you last friday, but to make sure I sent you a temp file of an article with an image just now again. The link to the image seems to be correct.
Thank you again for looking into this.
Offline
#71 2006-02-26 13:50:43
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] wan_pdf
I’m so sorry for causing all this confusion, everything is working fine now. It turned out that it was a javascript that I had in my article (to show an image only when a link was clicked) that caused the problem. Once I removed that everything was fine!
Thanks again Martin for all your help! And have a nice Sunday (what’s left of it…) ;)
Offline
Re: [plugin] [ORPHAN] wan_pdf
Nice plugin, thanks.
The only problem I have, is that the “ü,ö,ä” in the article title are not displayed correctly (using php 4.4.1)
Last edited by tranquillo (2006-02-26 16:30:05)
Offline
Re: [plugin] [ORPHAN] wan_pdf
Don’t have much time to test but following each step of all this… I’m sure several people in the Txp community would just tell you the same: thanks guys for doing all this…
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: [plugin] [ORPHAN] wan_pdf
Hi folks,
I’ve got little problem with the plugin, as you can see what happen when adding a <txp:wan_pdf /> tag to an article (debug mode):
bq. tag_error <txp:wan_pdf class=“pdflink” name=“Telechargez nos tarifs au format PDF” /> -> Notice: Undefined index: body<br /> tag_error <txp:wan_pdf class=“pdflink” name=“Telechargez nos tarifs au format PDF” /> -> Notice: Undefined index: excerpt<br /> tag_error <txp:wan_pdf class=“pdflink” name=“Telechargez nos tarifs au format PDF” /> -> Warning: main() [function.main]: open_basedir restriction in effect. File(/usr/share/php/ufpdf.php) is not within the allowed path(s): (/home/mywebsite.com/)<br /> tag_error <txp:wan_pdf class=“pdflink” name=“Telechargez nos tarifs au format PDF” /> -> Warning: main(ufpdf.php) [function.main]: failed to open stream: Opération non permise<br /> tag_error <txp:wan_pdf class=“pdflink” name=“Telechargez nos tarifs au format PDF” /> -> Warning: main() [function.include]: Failed opening ‘ufpdf.php’ for inclusion (include_path=’.:/usr/share/php:/usr/share/pear’)<br /> Fatal error: Class ‘UFPDF’ not found in /home/mywebsite.com/textpattern/lib/xhtml2pdf/classes/extendedfpdf.php on line 8
I checked for the open_basedir restriction. There is no problem: I can include one file from one other without any problem, in any folder. I also checked files permissions, it’s ok for reading any class file.
Do you have any idea about where I could find the solution to these errors? :\
Offline
Re: [plugin] [ORPHAN] wan_pdf
Ok it’s allright now, I’ve found the solution to my problem.
I modified include_once() call in extendedfpdf.php and ufpdf.php. They were looking like this:
include_once(‘ufpdf.php’); // in extendedfpdf.php
include_once(‘fpdf.php’); // in fpdf.php
And I had to change this to:
include_once(X_PATH_CLASS.’/ufpdf.php’); // in extendedfpdf.php
include_once(X_PATH_CLASS.’/fpdf.php’); // in fpdf.php
Now everything works fine. Thanks for this useful plugin, Martin :)
Offline