Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2006-01-25 22:20:39

chess
Plugin Author
Registered: 2005-11-10
Posts: 19
Website

Re: [plugin] [ORPHAN] wan_pdf

Wanni, this is working great now, thanks!!!

One little niggle, however: the “class” attribute does not seem to work. I have a CSS class called pdf:

.pdf { padding: 19px 19px 19px 0; height: 16px; width: 16px; background: url(/images/pdf16.gif) no-repeat 100%; }

to display a little pdf icon and it is not working. When I view source, the class tag is not added, so something is not getting parsed right.

Still, great job on this plugin. I have been waiting for this — thank you VERY much!!

Offline

#17 2006-01-25 22:34:36

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

Re: [plugin] [ORPHAN] wan_pdf

Nice to hear. I fixed the problem with the class attribute. I just forgot to add it to the link. But this plugin would not be possible without xhtml2pdf , so all the acknowledgements have to got to the french guys.

Offline

#18 2006-01-25 22:44:33

chess
Plugin Author
Registered: 2005-11-10
Posts: 19
Website

Re: [plugin] [ORPHAN] wan_pdf

works great now. thanks!

Offline

#19 2006-01-25 22:49:11

chess
Plugin Author
Registered: 2005-11-10
Posts: 19
Website

Re: [plugin] [ORPHAN] wan_pdf

wanni, one more request: the pdf version does not include the excerpt. when you get a chance, can you add it? thanks!

Offline

#20 2006-01-25 22:58:15

chriloi
Plugin Author
From: Vienna, Austria
Registered: 2006-01-17
Posts: 120
Website

Re: [plugin] [ORPHAN] wan_pdf

Where do you want to have your excerpt?`Above or below the body?

Offline

#21 2006-01-25 22:58:53

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

Re: [plugin] [ORPHAN] wan_pdf

Hi chess,

no problem, I will do this tomorrow. I think, the best way to do this is to control this via option, so one can decide if you want to include the excerpt and/or the body.

Offline

#22 2006-01-25 23:27:30

jackson
Member
Registered: 2005-10-01
Posts: 14

Re: [plugin] [ORPHAN] wan_pdf

Chriloi, I ususally use the excerpt to put in the first paragraph of an article, with the rest of the article in the body, so I would want the excerpt to be before (above) the body. Wanni, including the excerpt as an option would be fantastic, thanks!

Offline

#23 2006-01-25 23:29:38

chess
Plugin Author
Registered: 2005-11-10
Posts: 19
Website

Re: [plugin] [ORPHAN] wan_pdf

thanks, wanni! :)

Offline

#24 2006-01-26 01:32:30

ChrisJ
Member
From: Vienna, Austria
Registered: 2004-03-30
Posts: 54
Website

Re: [plugin] [ORPHAN] wan_pdf

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>

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>

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>

Still some path problems I suppose. Anyway, big thank you for your work.

Offline

#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

Board footer

Powered by FluxBB