Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2006-01-26 04:04:18

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: [plugin] [ORPHAN] wan_pdf

Woow! Finally! This is just awesome!
I’ve got one suggestion. Controlling the different elements of the article inside the pdf should be made easier by using a form template.
Eg: <code><txp:wan_pdf class=“pdf” form=“pdf_form” /></code> and in the form you can have something like this …

<blockquote>
<code><company logo>
<txp:title />
<txp:excerpt />
<txp:body />
© Copyright 2002–2005 YourCompanyName</code>
</blockquote>

Is this possible to implement?


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#26 2006-01-26 06:31:37

Niconemo
Member
From: Rhône-Alpes, France
Registered: 2005-04-18
Posts: 557

Re: [plugin] [ORPHAN] wan_pdf

Fantastic ! Thank you so much !


Nico

Offline

#27 2006-01-26 09:34:07

wanni
Archived Plugin Author
Registered: 2005-11-11
Posts: 32

Re: [plugin] [ORPHAN] wan_pdf

> ChrisJ wrote:

> It started to work when I commented <code>var $pdfdata;</code> line in the x2fpdf.php file. Otherwise:

<blockquote>Fatal error: Cannot redeclare xhtml2pdf::$pdfdata in /Users/xxx/Sites/xxx/textpattern/lib/xhtml2pdf/classes/x2fpdf.php on line 27</blockquote>

Hm, I have no idea at the moment, I will look at it.

> I also tweaked your plugin a bit, so it would store article’s title and keywords (visible in Acrobat’s Document Properties or OSX Preview – Document Info).

<pre>$xpdf->SetSubject($thisarticle[‘title’]);
$xpdf->SetKeywords($thisarticle[‘keywords’]);</pre>

Great idea, i will implement this in the next version.

> Things get bad when I wanted to print an article with images:

<blockquote><code>tag_error <txp:wan_pdf/> -> Warning: getimagesize(/Users/xxx/Sites/xxx/textpattern/lib/xhtml2pdf/images/77.jpg) [function.getimagesize]: failed to open stream: No such file or directory on line 215</code>
FPDF error: Missing or incorrect image file: /Users/xxx/Sites/xxx/textpattern/lib/xhtml2pdf/images/77.jpg</blockquote>

My first suggestion: try with absolute paths. I think it is a little bit difficult to alter relative paths to absolute paths, but this is on the todo-list.

Offline

#28 2006-01-26 09:41:14

wanni
Archived Plugin Author
Registered: 2005-11-11
Posts: 32

Re: [plugin] [ORPHAN] wan_pdf

> creativesplash wrote:

> I’ve got one suggestion. Controlling the different elements of the article inside the pdf should be made easier by using a form template.
> Eg: <code><txp:wan_pdf class=“pdf” form=“pdf_form” /></code> and in the form you can have something like this …

When I first thought about this plugin this was my first idea because this would be easily customizable. But I am not that familiar with textpattern so the problem was how to parse an article through a form and save it in a variable. If anyone knows how to do this, I would be very happy and I will try to implement this feature as soon as possible.

Offline

#29 2006-01-26 16:51:15

1beb
Plugin Author
From: Canada, Ontario, Toronto
Registered: 2004-11-22
Posts: 169
Website

Re: [plugin] [ORPHAN] wan_pdf

That’s amazing. Congrats on the integration!

Offline

#30 2006-01-28 00:10:05

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: [plugin] [ORPHAN] wan_pdf

I can’t get it to work on my local installation (both php4 and 5). I had to comment the same line 27 than ChrisJ. After that, all I get is a link to 1.pdf (title not present in link), and the downloaded file is without name (.pdf). If I open it, it is a blank page with the header. I use TXP 4.03.

Any hint on what it could be? Something in server default port (I don’t use port 80)?

Update: It doesn’t work neither in a live installation. The link point always to 3.pdf, that doesn’t download! Open a blank page in browser…

Z-

Last edited by Zanza (2006-01-28 00:21:27)

Offline

#31 2006-01-28 15:03:53

wanni
Archived Plugin Author
Registered: 2005-11-11
Posts: 32

Re: [plugin] [ORPHAN] wan_pdf

Puh, I don’t have any idea. I don’t think it depends on the port but maybe it’s the PHP-version. So what version do you have? I’m a little busy at the moment, but I hope, I can check this until tomorrow evening. I just used xhtml2pdf and didn’t go into details. But I will have a look at it.

Offline

#32 2006-01-28 17:43:43

RenJonsin
Member
From: Tarpon Springs, FL USA
Registered: 2005-02-06
Posts: 103
Website

Re: [plugin] [ORPHAN] wan_pdf

It looks like xtml2pdf only supports png and jpg images since I get the error “FPDF error: Unsupported image type: gif” AND ONLY THE ERROR on any page with a gif image.

I searched the internet and that seems to be pretty widespread. The solution always is to use only jpeg and png images which really isn’t a solution at all.

If anyone knows of a solution, that would be very welcome since this is an excellent application otherwise.

Offline

#33 2006-01-28 21:31:02

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] wan_pdf

Thanks for this great plugin! I’m having a few problems though.

  1. For articles with an image that is called with <txp:article_image /> in the article form, the image is not in the PDF. But I think I can solve that by adding an image tag in the article body. Am I right?
  2. This one is more serious: this site is in three languages, so every article is there three times. Some of the articles have the same title in every language (the url-only title is different, but the plugin seems to look at the title). So if for one article the PDF is created, it won’t happen again for the other two, and the download links are empty. I really can’t change the titles. Is there a way to solve this?
  3. In debugging mode, I get the following errors (the last one probably because of #2):

<pre><small>An error occurred in the following tag: < txp:wan_pdf name=“PDF” /> -> Notice: Undefined index: rights on line 340

An error occurred in the following tag: < txp:wan_pdf name=“PDF” /> -> Notice: Undefined index: STYLE on line 168
(this line 10 times)

An error occurred in the following tag: < txp:wan_pdf name=“PDF” /> -> Notice: Undefined index: author on line 78

An error occurred in the following tag: < txp:wan_pdf name=“PDF” /> -> Textpattern Error: Duplicate entry ‘Casa Dona Maria.pdf’ for key 2
insert into `txp_txp_file` set filename = ‘Casa Dona Maria.pdf’, category = ‘article_pdf’, permissions = ‘’, description = ‘21_93312787525ba143ce3b4e792106fee3’ on line 61</small></pre>

(Note: I added the spaces in the tags)

Last edited by doggiez (2006-01-28 21:37:28)

Offline

#34 2006-01-28 21:53:23

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] wan_pdf

Oh, and do I have to add something to the stylesheet to display tables properly?

Offline

#35 2006-01-29 16:02:50

wanni
Archived Plugin Author
Registered: 2005-11-11
Posts: 32

Re: [plugin] [ORPHAN] wan_pdf

I just released version 0.2. You have to download the modified xhtml2pdf.zip

Offline

#36 2006-01-29 16:14:41

wanni
Archived Plugin Author
Registered: 2005-11-11
Posts: 32

Re: [plugin] [ORPHAN] wan_pdf

@doggiez: I didn’t get tables working. There is table-support in FPDF but I think parsing in xhtml2pdf doesn’t work properly. It would be great if anyone had a solution.
problem 1: this should not be a problem, i only have to include the article image to the pdf or you put an image tag in the body.
problem 2: is solved in current version
problem 3: you are right, the last message comes from problem 2, the other warnings can be ignored in my opinion

@RenJonsin: You are right, fpdf only supports png and jpg, so unfortunately there will be no solution until it is implemented in fpdf

@Zanza: Mystirous. I can’t reproduce this. Is the pdf written to the files-directory an what name does it have?

Last edited by wanni (2006-01-29 16:18:40)

Offline

Board footer

Powered by FluxBB