DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:dw2pdf:discussion_old

Old discussions / Solved bugs

[Solved] Bookmarks not shown/ Adobe Reader freezes

Bookmarks are are not rendered in the pdf-file when a page starts not with Level 1 Headline (assumed You have in the admin configuration the “Max levels to show into bookmarks”>0). Adobe Reader (Vers. 9.3.1) freezes/crashes with Windows XP.

Changing the headline levels to start with Level 1 and so one gives a perfect pdf-file. — Karl 2010/04/09 16:55

[Solved] Brackets in code sections are shown as HTML entities

I have some code sections in pages. The brackets in code are not shown correctly in resulting PDF.

    var currValue = MyJSClass.TMPproperty.GetValue();
    alert("Current value is " + currValue);

The example above as renders in PDF:

  var currValue = MyJSClass.TMPproperty.GetValue();
  alert("Current value level is " + currValue);

Leon paskuda [at] gmail [dot] com

I found the solution myself, sorry for hassle :)

At file action.php there are function strip_htmlencodedchars which is used to convert some entities to valid markup/text. The brackets should be added there, and this solves the problem. Looks like this:

  $str = str_replace('(', '(', $str);
  $str = str_replace(')', ')', $str);
Thank's for tips. I add this changes in the next release. — mluigi 2010/04/26 12:18

[Solved] dformat

Tryed to create a PDF: Fatal error: Call to undefined function dformat() in …\DokuWikiStick\dokuwiki\lib\plugins\dw2pdf\action.php on line 140

the dformat() function is present only in recent version of DokuWiki: update it.
mluigi 2010/04/08 15:49

[Solved ?] UTF-8 Encoding Correctly?

Out of the box my dw2pdf plugin isn't encoding UTF-8 pages as UTF-8. Japanese and Chinese characters (all in UTF-8) end up as DejaVuSerif font, but all foreign characters show up as “?” and according to Acrobat they are encoded in ANSI. I've tried fiddling with all kinds of language and font settings in several of the PHP files, with no luck.

For reference, my DokuWiki page header looks like:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja"
 lang="ja" dir="ltr"> 
<head> 
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
...

I'm running the latest DokuWiki build on Ubuntu Karmic. Any ideas? If I've missed something stupidly simple please feel free to trash this post. :D — KouOuKen 2010/02/25 12:04

Same problem with Russian. 2010/03/11 16:40 Same problem with Korean.

> Hi, for problems with UTF-8 not encoding correctly, can You try to write some text in Your language on my wiki playground: test page ? Thanks. > — mluigi 2010/03/24 09:30

To solve the problems with the correctly encoding of UTF-8, in the dw2pdf/action.php, change
 $mpdf=new mPDF(); 

with

$mpdf=new mPDF('UTF-8-s'); 
$mpdf->SetAutoFont(AUTOFONT_ALL);

Please, give me a feedback. If is a good solution, a will insert in the next release — mluigi 2010/03/29 14:35

[Solved ?] Export entire site

So far this is the easiest to use and install DokuWiki plugin that exports to PDF. It also creates the cleanest looking PDF files, includes images, and preserves anchor links.

I want to export the entire site in a single PDF so that each article links to the other pages in the same PDF. I would accept having a PDF file for each page, but only if I could combine them into a single PDF and they would link to each other.

The only other plugin that comes close is Dokukiwix. But this plugin exports every page to HTML and then I must use Adobe Acrobat Professional to convert all of the HTML pages into PDF. This method ensures that a lot of formatting is messed up (especially <ul> and <ol>). I have attempted to run the LaTeX-based plugins, but for some reason I can't find the pdflatex binary or I can and I just don't know how to install it (Dokutexit is difficult to use). –mailto:steve [at] stevevance [dot] net

How it might work
I'm grabbing at straws here, but could it work like this:

  • Open the PDF with $mpdf=new mPDF();
  • With a loop, go through every page in the DokuWiki site and write the SetHeader(), SetFooter(), SetTitle(), WriteHTML(), to the PDF file.
  • Then, at the end of the loop, output the PDF file with $mpdf→Output(urlencode($siteName).'.pdf', $output);

>

See my other plugin: BookCreatormluigi 2010/03/31 17:06

[Solved] Table of Contents

There is no table of contents in PDF file. It could be great - Phil

[Solved] Different date and time styles

For Date
Make a configuration that allows dates to be displayed in the American style, that is MM/DD/YYYY instead of DD/MM/YYYY.

For Time
Make a configuration that sets the time to be 12-hour or 24-hour.

  • 12-hour: date(“g:i:s A”);
  • 24-hour: date(“H:i:s”);

mailto:steve [at] stevevance [dot] net

dw2pdf plugin use the new dformat function. Change DokuWiki configuration, to change style for date/time
mluigi 2010/03/16 09:14

[Solved] Tables not shown

Tables aren't showed in the PDF, is there a bugfix/workaround? — Laurent 2010/02/11 14:25

[Solved] Can not write in dokuwiki directory

cactux 2010/01/30 23:25
When exporting to PDF, I got the error could not write in the directory, which turned out to be the root directory of the DokuWiki install. I added this line:

chdir("/tmp");

in the file mpdf.php, at line 7794, just after the comment “create temp alpha file”. It works fine now. Maybe it would be better to set it to data/tmp?

Thanks. You got this problems only with PNG images with alpha channel. I try to resolve this problems into new release, adding a new variable for temp dir.
mluigi 2010/01/31 08:24

[Solved] No renderer 'pdf' found for mode 'pdf'

I am receiving this error after installing the plugin, and clicking the 'Export to PDF' button on a page.

I fixed my own error, this was because the plugin manager would not install it so I had to do it manually, and named the plugin folder 'pdf'. The folder NEEDS to be named dw2pdf, then the problem is resolved.

[Solved] Ampersands (&) are being HTML-encoded into &amp;

Anywhere on the wiki page that uses an ampersand (&) is being converted into the HTML safe symbol (&amp;). Amongst other problems, this is causing URLs not to work within the PDFs.

[Solved] ACLs ignored

DW2PDF ignores ACLs when a static link reference is used to a namespace which is read-protected. file is downloaded regardless of user access level.

in order to reproduce:

  • create namespace “protected”
  • set ACL to @ALL = None
  • create page mypage
  • Access link without being logged in.

Browser should show default “Access denied” page. Instead, PDF with actual page content is returned.

[Solved] Directory Structure of dw2pdf.zip

Could you please structure the contents of dw2pdf.zip with the directory dw2pdf.
This should automatically create this directory and avoid overriding of action.php in the plugin root directory. Thanks, Joachim, 03.03.2010

[Solved] Pagebreak in DokuWiki page for dw2pdf

Is there any way to insert pagebreaks in the DokuWiki page, which are handled by dw2pdf?
The plugins “pagebreak” or “wrap pagebreak” do not work. Thanks, Joachim, 03.03.2010

Thank you for your fast response to my article.
It seems that the DokuWiki plugins “pagebreak” with “<pagebreak>” or “wrap pagebreak” with “<wrap pagebreak></wrap>” still do not work.

I tried <html><pagebreak /></html> this seems to work. Thanks, Joachim, 05.03.2010
You must use WRAP plugin or PAGEBREAK plugin or use a direct code <html><pagebreak /></html>
mluigi 2010/03/05 09:14

not working: WRAP plugin with “<wrap pagebreak></wrap>”, print preview is OK, so I'm sure to use it in the right way.
working is: PAGEBREAK plugin with “<pagebreak>” and direct code <html><pagebreak /></html> Joachim, 05.03.2010

The correct syntax is <WRAP pagebreak></WRAP> not <wrap pagebreak></wrap>: for WRAP plugin, WRAP is for div element and wrap is for span element; try on my wiki: test page
mluigi 2010/03/05 15:29

In order to get pagebreaks to work for me using the pagebreak plugin I had to modify the translated HTML inside of syntax.php, otherwise pagebreaks wouldn't work for me in any browser:

$renderer->doc .= "<div style=\"page-break-before:always;page-break-inside: avoid;\">&nbsp;</div>";

nadams 2012/11/05 04:47

I want to put some things in the footer. One of it is Last update. But I want write it in German. The German word for update is Änderung. For that I need the HTML-Tag, because the Umlaut is ignored in the PDF. If I write it in HTML (&Auml;), in the PDF is written &Auml;nderung. I also want to use the bold-tag (<B>). It's also not possible.

There is a simple way I think:
* open action.php
* look for line 103 or so
* be sure that Your editor does UTF-8 encoding
* change „Last update“ to „Letzte Änderung“
* set Your change in <b>-tag
But remember: If Luigi gives us a new version You have to make Your changes again (and again and again). Hope that helps
Karl 2010/03/09 17:14

Solved with new version: configuration on admin-side

[Solved] Empty page - no PDF file

Empty page on : http://mywebsite.com/dokuwiki/doku.php?do=export_pdf&id=start What are the requirements ? I'm on DokuWiki Release 2009-02-14b Thanks - Phil

Try to use two pagebreak: <WRAP pagebreak></WRAP><WRAP pagebreak></WRAP> or two <html><pagebreak /></html> <html><pagebreak /></html>
mluigi 2010/03/10 17:47

Thanks

I put <html><pagebreak /></html> <html><pagebreak /></html> at the top of the “start” page : Doesn't works - empty web page, no PDF file.

Should i install another more plugin or any configuration in the main.php ? - Phil

Can You send me (by mail, if you want) the URL of Your wiki ?
mluigi 2010/03/12 15:30

I have the same “empty page” problem, since the very first version of this plugin. Are there any new ideas to solve it? — viola 2010/03/16 16:20

See here: http://mpdf1.com/manual/index.php?tid=391&searchstring=debug to set debug mode of mPDF and post result
mluigi 2010/03/16 16:30
I set debug mode “true” - but no difference: page is still empty.
viola 2010/03/16 16:20
After I updated DokuWiki to current 2009-12-25c lemming version : All works perfectly Thanks - Phil

[Solved] Cannot show Chinese Words in PDF

Acrobat show squares [][] for the Chinese characters. However, when I copy those squares, and paste to notepad, I see those Chinese characters!!!

Can anyone tell me how to fix it? Thanks!

Chris

Solution: Replace the original mPDF by mPDF 5.0 (in fact 4.5 work too).

Chris

=⇒ Confirmed! Works also with Japanese characters. Thanks Chris!

[Solved] Change initial view options in Acrobat

I see from the mPDF site that it's possible, I just don't know how to implement it with this plugin. Any ideas?

Yes, it is pretty easy. In the file dokuwiki/lib/plugins/dw2pdf/action.php locate the line

$mpdf=new mPDF('UTF-8-s'); 

and immediately after it add this line:

$mpdf->SetDisplayMode('fullpage'); 

The parameter can be 'fullwidth' or 90 etc. It seems to work in Adobe Reader.

Regards Jonas

– Confirmed that it works, thanks, Jonas. Also thank you for showing us how we can add mPDF functions to the dw2pdf plugin.

[Solved] No underline supported

Words that are underlined with some underline (like this), will print in the pdf as italic.

Using Version 2010-02-04 on dokuwiki 2009-12-25c “Lemming”.

apuschmann 2010/08/27 13:49

I added the followwing to my user.css:

em.u {
  font-style: normal;
  text-decoration: underline;
}
em em.u {
  font-style: italic;
}

my sure you enable the use of user.css n the options.

Theo-K 2010/09/24 09:38


I have no problems at all installing plugins but this one here causes only blank pages also when I try to install this plugin manually. I guess this plugin is just too huge. 47MB to create simple PDFs. Jeez.

plugin/dw2pdf/discussion_old.txt · Last modified: 2015-06-17 09:42 by 41.164.141.210

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki