Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#97 2006-08-30 20:38:15

Buddy Bradley
Member
From: Peterborough, UK
Registered: 2004-07-01
Posts: 12
Website

Re: [plugin] [ORPHAN] wan_pdf

I’m using this plugin and it works fine, except for any quotes in my article (either single or double) or hyphens come out as question-marks in the PDF. I’ve tried using utf-8 and iso-8859-1 Content-Type and both are the same.

The quotes are just normal keyboard single and double quotes, no smart quotes or anything. Same thing with the hyphens – just a basic keyboard minus sign. I’ve tried adding quotes and hyphen to the preg_match_all character-replacement function in the plugin, but with no success.

Anyone else had this problem, or can point to a fix?

Edit: I see others have the same problem, but no solution has been found yet?

Edit: I found this which sounds like it’s going in the right direction…

Last edited by Buddy Bradley (2006-08-30 21:10:57)

Offline

#98 2006-11-02 10:34:58

M_i
Member
Registered: 2006-03-05
Posts: 122

Re: [plugin] [ORPHAN] wan_pdf

Buddy Bradley wrote:

I’m using this plugin and it works fine, except for any quotes in my article (either single or double) or hyphens come out as question-marks in the PDF.

I’m having the same problem (even with PHP 4). When you type normal (straight) quotes in Textile, they’re automatically converted to curly ones. And then to ? when I generate a PDF. Strangely enough, I do get some special characters in the PDF (eg. é does appear, but ë turns into a ?).

Also, a lot of my articles, even in Textile mode, have bits of HTML code such as horizontal rules (<hr>) in them. I’ve found that the PDF only shows text up to the first horizontal rule, and everything after is omitted.

Offline

#99 2006-11-07 09:48:58

Cookie
New Member
From: Germany
Registered: 2006-11-06
Posts: 3

Re: [plugin] [ORPHAN] wan_pdf

Hi wanni, nice plugin?
The plugin works really nice with php 4.4.1 but in php 5 “ä,ö,ü” are not displayed correct. This is only as information and maybe you append this information to your plugin as fare as this behaviour is not to explain.

furthermore I have a feature request:
It would be nice if the pdf-output works on demand without saving a file in the web-space.

a hint
Except the help-file say`s, for styling header and footer you only have to edit the config.ini in the xhtml2pdf-directory!

Thanks a lot!

Last edited by Cookie (2006-11-07 20:30:21)

Offline

#100 2006-11-08 16:20:21

Cookie
New Member
From: Germany
Registered: 2006-11-06
Posts: 3

Re: [plugin] [ORPHAN] wan_pdf

Hello wanni,

may it be possible to include the authors name and the Date of posting into the pdf like title and body?

Ciao

Offline

#101 2007-01-28 19:45:12

raveoli
Member
From: Copenhagen
Registered: 2004-03-06
Posts: 205
Website

Re: [plugin] [ORPHAN] wan_pdf

Sometimes images are output, and other times not. It seems like article images break images alltogether…

Hmm, it does not seem like article images are supported? Images inserted in the article via txp tags are output in the pdf, but images inserted as article images, are not.

Is it possible?

Last edited by raveoli (2007-01-28 19:58:10)

Offline

#102 2008-01-31 14:12:06

fbox
Member
From: Melbourne
Registered: 2006-02-18
Posts: 42

Re: [plugin] [ORPHAN] wan_pdf

For those readers out there finding it hard to get their hands on xhtml2pdf.zip (because a download link is not mentioned on the TXP resources site at http://textpattern.org/plugins/535/wan_pdf nor here in the forum), the trusty link can be found at last on Wanni’s website, at the bottom of the page: http://wannert.net/blog/textpattern-plugin-zur-pdf-ausgabe-der-artikel

Download: xhtml2pdf.zip

L.

Offline

#103 2008-07-26 19:09:10

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 305
Website GitHub Twitter

Re: [plugin] [ORPHAN] wan_pdf

I found a solution for the umlauts and quotes problem.
It works for me in textpattern 4.0.6 and php 5.2.5, Euro-Sign, Umlauts and most of the quotes now right , but inverted commas not completely right drawed.

After upgrading xhtml2pdf in /textpattern/lib/xhtml2pdf/ to v0.3 (it now uses TCPDF instead of UPDF or FPDF)
I had to change the following lines in tcpdf_extends.php in the “SetFont” function, beginning in the 7th row,
I had to replace

if($family=='') {
$family=$this->FontFamily;
}

with

if($family =='' && $this->FontFamily != '') {
$family=$this->FontFamily;
}
else
$family='freeserif';

because of a “TCPDF error: Undefined font: B”.
The solution I found here

After that I changed only the “x2fpdf” call in the “wan_pdf” – plugin code to “xfpdf” and it worked.
You can get xhtml2pdf v0.3 here

If you choose “freeserif” the pdf-files will get too big, because of the embedded true type fonts.
You can get better and smaller files by embedding compressed type1 fonts with only needed charsets.
The setup is described here.

There are still problems, maybe a more competent person will find solutions.

- whocarez –

p.s. sorry for my English …

Last edited by whocarez (2008-07-27 20:08:03)

Offline

#104 2008-08-01 01:39:31

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 305
Website GitHub Twitter

Re: [plugin] [ORPHAN] wan_pdf

A better solution for the umlauts and quotes problem is to replace some symbols before generating the html file.

Edit the wan_pdf plugin and put before the following lines

// generate HTML first
      if (is_writable($tempdir."/")) {

something like that

// replaces some characters 
// left single quote
      $body = str_replace('&#8216;', '&#145;', $body); 
// right single quote
      $body = str_replace('&#8217;', '&#146;', $body); 
// left double quote
//    $body = str_replace('&#8220;', '&#147;', $body); 
// low left double quote for German
      $body = str_replace('&#8220;', '&#132;', $body);  
//  right double quote
      $body = str_replace('&#8221;', '&#148;', $body); 
// en dash
      $body = str_replace('&#8211;', '&#150;', $body); 
// em dash
      $body = str_replace('&#8212;', '&#151;', $body); 
// Euro-Sign
      $body = str_replace('€', '&#128;', $body); 
// bullet
      $body = str_replace('&#8226;', '&#145;', $body);

Last edited by whocarez (2008-08-01 22:23:33)

Offline

#105 2008-12-03 23:18:11

danwoodward
Member
From: Brooklyn NY
Registered: 2006-08-06
Posts: 51
Website

Re: [plugin] [ORPHAN] wan_pdf

Does anyone have this plugin, download links don’t work. It seems like more and more txp plugins are going extinct…. :(

Offline

#106 2008-12-04 00:44:52

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: [plugin] [ORPHAN] wan_pdf

Dan

I have a mirror of the source code here. You’ll need to compile it for yourself though.


Steve

Offline

#107 2009-12-05 22:50:20

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

Re: [plugin] [ORPHAN] wan_pdf

I wonder has anyone extended or tweaked this plugin to create pdfs from article lists or in other words any rendered html.


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#108 2011-11-11 04:10:40

elwins
Member
From: Latvia
Registered: 2011-08-29
Posts: 80

Re: [plugin] [ORPHAN] wan_pdf

maybe someone can publish plugin code ?

Offline

Board footer

Powered by FluxBB