|
Latest versions of CreatePdfDocument.py 2.4.2, PDFIcon.py 1.1.0, PDFControl.py 1.0.1 |
Coded with WingIDE (http://www.wingide.com) open-source license. |
Contents
- CreatePdfDocument action
- PDFControl macro
- PDFIcon macro
- Configuration and defaults
-
Bugs
- v2.4.2: Don't destroy HTML when macro MiniPage is used for nested tables
- v2.4.2: Don't hide empty table cells
- v2.4.2: UTF-8 characters in Table-of-Content title
- v2.4.2: FastCGI: duplicate header 'Content-Type'
- v2.4.2: No images in PDF if they were created with {{drawing:xxx.adraw}} (under investigation)
- v2.4.1: Calling add_msg() after send_title(): no message can be added (under investigation)
- v2.4.1: Missing images (fixed in v2.4.2)
- v2.3.6 and MoinMoin 1.5.8 using 'title file/image': 'module' object has no attribute 'exists' (fixed in v2.4.0)
- v2.3.6 ERR005 and ERR012 with latest PdfAction on (standalone) MoinMoin 1.6.x (resolved/invalid)
- v2.3.5: ERR017 with MonthCalendar Macro (fixed in v2.3.6)
- v2.3.4: Traceback after changing the Title and heading 1 as title (fixed in v2.3.5)
- v2.3.4+p1: Python crashes when no user logged in and no previous cookie is present (fixed in v2.3.5)
- v2.3.4: Can't use "JPEG big images" different from "None", wrong hmtldoc parameter form (fixed in v2.3.5)
- v2.3.4: AttributeError thrown for anonymous users if anonymous sessions are disabled (fixed in v2.3.5)
- v2.3.3: extra-dynamiccodeblock-break doesn't work (fixed in v2.3.4)
- v2.3.2: Standard Input Error on standalone server (fixed in v2.3.3)
- v2.3.1: Pictures missing for ACL protected pages (fixed in v2.3.2)
- v2.3.1: Surge protection interference (fixed in MoinMoin v1.7.1)
- v2.3.0: AttributeError (fixed in v2.3.1)
- v2.3.0: Wrong Author Name (fixed in v2.3.1)
- v2.2.0: Missing UTF-8 support
- v2.2.0: Cut-off code block (fixed in v2.3.0)
- v2.2.0: Missing Table Borders (fixed in v2.3.0)
- Feature requests
- Discussion
-
Troubleshooting
- Pictures missing in PDF
- Pictures missing in PDF (part 2)
- Pictures missing in PDF (part 3)
- Pictures missing in PDF (part 4) (applied in v2.3.2)
- New Page Tag
- Using the Frame macro
- "Book" style skips text before Heading 1 (works as designed)
- In listings eol sign unwanted
- output big images
- HelpOnAdmonitions
- Scale/Fit big images
- problems
- ideas
CreatePdfDocument action
Please download and rename this action plugin to CreatePdfDocument.py and install it as described in ActionMarket. If everything goes right you will see an additional menu entry in your more actions drop-down list.
This program uses the external HTMLDOC application you have to install yourself. For Debian/Ubuntu users: sudo apt-get install htmldoc
Windows users will have to compile the HTMLDOC application source or google for a Windows binary. One current source is http://htmldoc-binaries.org/ or you can download this copy HTMLDOC_1.8.27.msi. The installer does not add htmldoc to the system path so you will need to add the following configuration line in your MoinMoin configuration file e.g. farmconfig.py (Please refer to HelpOnConfiguration):
# -*- coding: iso-8859-1 -*- from MoinMoin.config.multiconfig import DefaultConfig class Config(DefaultConfig): createpdfdocument_defaultvalues = { 'htmldoc_cmd': u'\progra~2\htmldoc\htmldoc', }
PDFControl macro
With HTML comments exist further control possibilities for HTMLDOC. The HTMLDOC documentation gives a nice overview about them.
To be able to add comments within the HTML document the PDFControl macro was developed. Latest version can be found here: PDFControl1_0_1.py
The usage is simple. To create a new page write [[PDFControl(NEW PAGE)]] within your page. NEW PAGE will be written as <!-- NEW PAGE --> within he document. In other words, PDFControl create HTML comments with support for preview mode.
PDFIcon macro
This macro makes it simple to generate PDF documents from a page by clicking. No further configuration is mandatory. Previously saved ##pdf settings are considered.
A picture is displayed on the right side of the screen. Place the [[PDFIcon]] macro in the line you intent to display the picture.
A picture called /icons/pdf.png has to exist. Download if you are looking for an example. Otherwise overwrite the pdficon_imageurl configuration variable.
The [[PDFIcon]] macro can be downloaded here: PDFIcon.py
Take a look at http://www.solutions4linux.de/wiki/StartSeite?action=CreatePdfDocument to see how it looks and works.
Configuration and defaults
The default settings are defined in CreatePdfDocument.py. Search for self.default_values and self.valid_options for possible value combinations. Here some examples:
Parameter
Values
Comment
size
legal, a4, letter, universal
self-explanatory
style
book, webpage, continuous
The same as the menu
format
pdf11, pdf12, pdf13, pdf14
Identical with the PDF version format
linkstyle
underline, plain
self-explanatory
firstpage
c1, p1, toc
c1=1st chapter, p1=1st page, toc=Contents
pagemode
outline, document, fullscreen
self-explanatory
pagelayout
single, one, twoleft, tworight
one=One column, twoleft=Two column left, tworight=Two column right
In particular, we want a A4 page size and the viewer should jump to the first chapter if the document is opened. Change your MoinMoin configuration file e.g. farmconfig.py as follows (Please refer to HelpOnConfiguration):
# -*- coding: iso-8859-1 -*- from MoinMoin.config.multiconfig import DefaultConfig class Config(DefaultConfig): createpdfdocument_defaultvalues = { 'size': u'a4', 'firstpage': u'p1', }
Bugs
v2.4.2: Don't destroy HTML when macro MiniPage is used for nested tables
When the macro MiniPage is used on a page (to implement nested tables), we have to use a more restrictive regexp to prevent destroying the HTML.
This patch fixes the issue:
--- CreatePdfDocument2_4_2.py 2015-06-18 17:51:36.000000000 +0200 +++ CreatePdfDocument2_4_2_with-dont-break-minipage-macro-in-tables.py 2016-01-20 10:42:26.810799906 +0100 @@ -1724,7 +1724,7 @@ html = re.compile(r'<ul id="pagelocation">.*?</ul>', re.IGNORECASE | re.DOTALL).sub(u'', html) # HTMLDOC workarround: There is no CSS support in HTMLDOC. - tablecolor = re.compile(r'<td.*?background-color: (#......).*?>') + tablecolor = re.compile(r'<td[^>]*?background-color: (#......).*?>') for match in tablecolor.finditer(html): html = html.replace(match.group(0), u'<td bgcolor="%s">' % match.group(1), 1)
-- JonasZeiger 2016-01-20 10:50:20
v2.4.2: Don't hide empty table cells
htmldoc don't show empty table cells. The attached patch fills empty cells a non-breaking space ( ). Thereby htmldoc won't suppress the cells now.
--- CreatePdfDocument.py.old 2012-04-27 09:44:21.042526000 +0200 +++ CreatePdfDocument.py 2014-11-04 12:23:34.642700000 +0100 @@ -1711,6 +1711,9 @@ for spanmatch in [r'<span[^>]*>', r'</span>']: html = re.compile(spanmatch).sub(u'', html) + # HTMLDOC: Show empty table cells + html = re.compile(r'<td></td>', re.IGNORECASE | re.DOTALL).sub(u'<td> </td>', html) + # HTMLDOC: Does not support JavaScript. html = re.compile(r'<script type="text/javascript".*?</script>', re.IGNORECASE | re.DOTALL).sub(u'', html)
-- CarstenGrohmann 2014-11-04 18:10:38
v2.4.2: UTF-8 characters in Table-of-Content title
When I choose Swedish word as title (Innehåll" I get the fault below. It turns out that it is python execv that complains as can bee seen from apache error log "TypeError: execv() arg 2 must contain only strings". When I use only ascii character it works fine.
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
v2.4.2: FastCGI: duplicate header 'Content-Type'
with a clean install of moinmoin 1.9.3, mod_fastcgi and CreatePDFDocument 2.4.2 I get the following message in the apache error-log:
FastCGI: comm with server "/opt/moin/wiki/server/moin.fcgi" aborted: error parsing headers: duplicate header 'Content-Type', ...
doing an strace on the thread shows the following result:
sendto(5, "Status: 200 OK\r\nContent-Type: text/html; charset=utf-8\r\nVary: Cookie, User-Agent, Accept-Language\r\nContent-Length: 466496\r\nContent-Type: application/pdf\r\nContent-Disposition: inline; filename=\""..., 364, 0, NULL, 0) = 364
So you see that Content-Type is really sent twice with different values (text/html first then application/pdf). I know it was working with an earlier version of moinmoin (1.5.6) and CreatePDFDocument (2.2.0).
Any ideas how to fix that?
As per 191AttachmentsProduceDuplicateHeaderErrorWithFastCGI the following construct should not get used:
request.headers.add(k,v)
Instead this should get used:
self.request.headers[k]= v
The following patch solves the issue:
--- CreatePdfDocument2_4_2.py 2011-06-27 03:48:54.000000000 -0700 +++ CreatePdfDocument.py 2011-06-27 04:52:12.000000000 -0700 @@ -1598,7 +1598,7 @@ self.request.emit_http_headers(pre19) else: for k,v in more_headers.items(): - self.request.headers.add(k, v) + self.request.headers[k]= v def send_pdf(self, data):
-- MartinSperl 2011-06-27 09:33:39
v2.4.2: No images in PDF if they were created with {{drawing:xxx.adraw}} (under investigation)
Hi, I tried to make a PDF out of a page which had drawings (HelpOnDrawings) in it
{{drawing:test.adraw}}
Result: The image was not in the PDF. "Normal" images were correctly converted to the PDF. JosefMeier 2010-09-26 14:17:52
I've used the HelpOnDrawings/anywikitest.adraw with success (MoinMoin 1.9.3, HTMLDOC 1.8.27). Could you forward me the adraw file? -- RaphaelBossek 2010-09-26 15:38:30
I could reproduce this bug, but it's only happen if the pagetitle contains a %, for example create a page like "100% true" (without the quotation mark). So I think this plugin do some wrong encoding when fetching the drawing files. -- MarcelHäfner 2010-11-01 16:35:55
v2.4.1: Calling add_msg() after send_title(): no message can be added (under investigation)
Hi, I tried 1.9.2.pre and got this failure, any ideas? pdfbug.txt
I'm not able to reproduce this issue with MoinMoin 1.9.3. Please install latest version of CreatePdfDocument and MoinMoin and restart your test. -- RaphaelBossek 2010-09-18 16:24:52
- I have the same issue on 1.9.3 with the very same traceback. (I'm using the mandarin theme if that's a useful info, as it's the only difference from the "base" package)
- I have the very same problem with 1.9.3 - CentOS5 installed as seen here. No fix to find.
Ok, I see that I should spend some time on this issue. -- RaphaelBossek 2011-03-11 10:21:42
Same here with CreatePdfDocument 2.4.2 and MoinMoin 1.9.1 (Desktop Edition) 2011-03-27 13:41:42
Also here the same error CreatePdfDocument 2.4.2 and ! . MoinMoin 1.9.2-2ubuntu3.2 , 2012-12-23 15:00:00
And same problem with MoinMoin 1.9.6 and CreatePdfDocument 2.4.2 on Centos 6.2, 2013-07-23 12:53:00
This output seems to be triggered by the error output handling of MoinMoin's base theme class (theme/init.py - line 1575: if self._send_title_called:). Disabling this if-branch works around that issue and exposes a real htmldoc error (in my case: /bin/sh: 1: --cookies: not found and Can't open display:). I am using the mandarin theme as well - thus the issue seems to be related to mandarin's error handling. The attached patch fixes the underlying htmldoc problem for me. 2014-08-18 04:05:00
v2.4.1: Missing images (fixed in v2.4.2)
We updated our wiki to MoinMoin 1.9.3 and CreatePdfDocument.py 2.4.1 (Debian lenny, python 2.5.2-15+lenny1) . Since then the PDF documents don't contain the images any more. Any ideas what to look for? -- RalfGroß 2010-09-14 07:16:39
Could you please check if the "Preview" (button) is working. If it does, "Enable debugging information" in "Extras" tab. Repeat the actions and check if the pictures are there. As next make sure MoinMoin accept concurrent access (multi-threaded) because htmldoc is started in parallel accessing the same page, to be exact, download the referenced pictures only. Be aware that BMP images are not supported by htmldoc. -- RaphaelBossek 2010-09-14 07:46:33
I will test that. Before that some more test results. The same png image is working on some pages in the same wiki, but not on others. That means, sometimes it's added to the pdf, sometimes not. If not, no images are in the pdf at all. So I guess it's not a problem with this image. Even if I create a new page only with in it, it will not be in the PDF. If I add the same image to an existing page which already has some images and where the images are correctly added to the pdf, this image is also part of the pdf then. Very strange. -- -- RalfGroß 2010-09-14 08:00:32
Ok, the Preview button is there and the preview shows the image. I enabled debugging in the Expert tab. But then I don't get an PDF anymore when clicking on "Generate PDF", only the Preview. This is the debug output I get http://pastebin.com/1CSzL8RC. -- RalfGroß 2010-09-14 08:10:54
May I get access to this wiki? Please wirte me an email with further informations to <raphael.bossek@gmail.com> -- RaphaelBossek 2010-09-14 08:13:39
This will not be possible I fear, the system is behind a firewall. There might be way with a netviewer session, but you'll need a windows system. I did some additional testing and saved the generated html preview to disk. I used htmldoc --continuous test.html -t pdf > test.pdf on the server and on my desktop to create the pdf, both files contains the image. -- RalfGroß 2010-09-14 08:28:25
Do you see in the MoinMoin log if htmldoc is reading the pictures? Are there any errors which may result from this issue? -- RaphaelBossek 2010-09-14 08:47:38
I used the command that the debug output returns to created the pdf with the html preview htmldoc --cookies MOIN_ID=1106916782.9.28337 --no-duplex --tocheader .t. --bottom 0.50in --header t.D --left 1.00in --linkcolor 0000E0 --headfootsize 11.0 --textcolor 000000 --size legal --pagelayout single --continuous --compression 0 --title --tocfooter ..i --charset iso-8859-1 --firstpage c1 --toclevels 3 --linkstyle underline --toctitle Inhaltsverzeichnis --format pdf13 --headfootfont helvetica --fontsize 11.0 --fontspacing 1.2 --top 0.50in --headingfont helvetica --numbered --embedfonts --footer ./. --bodycolor FFFFFF --bodyfont times --browserwidth 680 --right 0.50in --pagemode outline --jpeg=0 --permission copy,print,modify,annotate and the image is in the pdf. I raised the log level in /server/wikis/cgi-bin/moin.log to DEBUG but I find nothing about the image in the log file. I see some messages from the CreatePDF macro, but nothing about images, not even if I create a pdf where images are working. -- RalfGroß 2010-09-14 08:58:27
Is there anything more I can do or info I can provide? What moin log setting should I change to get more information? -- RalfGroß 2010-09-16 11:28:34
Ok, something new. I read the rest of this page and found that there were some problems with ACL protected pages. So I added #acl All:read and the images are correctly added to the pdf. But I don't get an access denied or something similar without this and htmldoc 1.8.27 is installed. Giving all useres read access is not desired, is this a known problem with htmldoc 1.8.27 too? -- RalfGroß 2010-09-16 11:49:38
You mentioned before that (for a protected page) get the textual content as PDF but the pictures are missing only. Is this true for this case where you restore your ACL to previous status? Please press the "Preview" button for such a page (where the pictures) are missing and save it as ZIP file so I can check the URLs within the page, or send my some URLs refering pictures (that are missing in the output PDF). By the way, CreatePdfDocument uses the --cookies MOIN_ID=1106916782.9.28337 to get access to your Wiki system, so ACL should not be an issue. -- RaphaelBossek 2010-09-16 11:57:48
well... I can reproduce it with the ACL settings. The whole wiki tree has default ACLs and some pages also have specific page ACLs. Most of the pages have no read all ACL. If I add a read all ACL, the images are included. If I then remove the read all ACL again, the images are not included. It seems that the problem began with moin 1.9.x. We updated from 1.8.x to 1.9.3 only a few weeks ago. Before that no user complained about missing imges, and they are using the macro regularly -- RalfGroß 2010-09-16 12:08:08
log file without #acl All:read moin.log.failed.gz
log file with #acl All:read moin.log.ok.gz
Great, I'm able to reproduce the problem on my development machine. I'll check what's going on. Will take some time. -- RaphaelBossek 2010-09-16 12:50:32
very good additionally I got some hints on #moin IRC. They pointed me to these lines of code: http://hg.moinmo.in/moin/1.9/file/7a83cc907f68/MoinMoin/action/AttachFile.py#l122 I've no clue if this helps you... -- RalfGroß 2010-09-16 12:55:08
Please download this new version CreatePdfDocument2_4_1+p1.py which contains a first fix for this issue. I've to do more deep testing with older MoinMoin version then 1.9. Until the tests are finished please use this version and feel free to report further issues, if any. -- RaphaelBossek 2010-09-17 13:25:01
Thanks for your efforts! I've installed the new version and a test showed no problems with images on ACL protected pages. I've informed the users about this and they will do further testing. Thanks! -- RalfGroß 2010-09-17 13:39:32
v2.3.6 and MoinMoin 1.5.8 using 'title file/image': 'module' object has no attribute 'exists' (fixed in v2.4.0)
If I try using logo.png in title, I get AttributeError, with end of trace like this:
/data/www/wiki/CreatePdfDocument.py in html2pdf (self=<MoinMoin.action.CreatePdfDocument.CreatePdfDocument instance at 0x84427cc>, html=u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN...v id="pagebottom"></div>\n</div>\n</body>\n</html>\n\n') 8. /data/www/wiki/CreatePdfDocument.py in attachment_fsname (attachment=u'logo.png', page=<MoinMoin.Page.Page instance at 0x834336c>, request=<MoinMoin.request.RequestCGI object at 0xb7dec54c>) AttributeError 'module' object has no attribute 'exists' * args = ("'module' object has no attribute 'exists'",) * message = "'module' object has no attribute 'exists'"
Without title image works ok.
I can confirm this issue with MoinMoin 1.5 working on a solution. -- RaphaelBossek 2009-06-09 21:07:45
v2.3.6 ERR005 and ERR012 with latest PdfAction on (standalone) MoinMoin 1.6.x (resolved/invalid)
I've just installed this and get these errors:
Command:
htmldoc --cookies MOIN_ID=1234840003.53.23190 --no-duplex --tocheader .t. --bottom 0.50in --header t.D --left 1.00in --linkcolor 0000E0 --headfootsize 11.0 --textcolor 000000 --size a4 --pagelayout single --webpage --compression 0 --title --tocfooter ..i --charset iso-8859-1 --firstpage c1 --toclevels 3 --linkstyle underline --toctitle Contents --format pdf13 --headfootfont helvetica --fontsize 11.0 --fontspacing 1.2 --top 0.50in --headingfont helvetica --numbered --embedfonts --footer ./. --bodycolor FFFFFF --bodyfont times --browserwidth 680 --right 0.50in --pagemode outline --jpeg=0 --permission copy,print,modify,annotate -
returned:
ERR005: Unable to find "0"... PAGES: 2 ERR012: Unable to write document file - Permission denied
Solution: htmldoc was trying to write to /var/tmp and didn't have permission. Fixed.
v2.3.5: ERR017 with MonthCalendar Macro (fixed in v2.3.6)
After installing the latest PdfAction Files on my MoinMoin 1.8.x I receive the following error:
Commandline:
/home/lotek/bin/htmldoc --cookies MOIN_ID=1164234067.18.4109 --no-duplex --cookies MOIN_SESSION=4nqhjqfd3993s_uo03txk8a9p05uq07v --tocheader .t. --bottom 0.50in --header t.D --left 1.00in --linkcolor 0000E0 --headfootsize 11.0 --textcolor 000000 --size a4 --pagelayout single --webpage --compression 0 --tocfooter ..i --charset iso-8859-1 --firstpage c1 --toclevels 3 --linkstyle underline --toctitle Inhaltsverzeichnis --format pdf13 --headfootfont helvetica --fontsize 11.0 --fontspacing 1.2 --top 0.50in --headingfont helvetica --numbered --embedfonts --footer ./. --bodycolor FFFFFF --bodyfont times --browserwidth 680 --right 0.50in --pagemode outline --jpeg=0 --permission copy,print,modify,annotate -
Error Message:
ERR017: Unknown style property "visibility"! ERR017: Unknown style property "z-index"! PAGES: 1 BYTES: 102696
The problem ocures only if you use the <<MonthCalendar>> Macro. Because of some "style property".
Could you please describe your call of MonthCalendar? A simple <<MonthCalendar(SampleUser,,12)>> is not enought to catch the problem. -- RaphaelBossek 2009-01-11 22:01:26
I believe that this HTML from the MoinMoin Macro creates the problem. Btw. I only use <<MonthCalendar>> , nothing else:
<div id="infodiv" style="position:absolute; visibility:hidden; z-index:20; top:-999em; left:0px;"></div>
This HTML is generated by the Macro MonthCalendar.py arount 422:
421 <script type="text/javascript" src="%s/common/js/infobox.js"></script> 422 <div id="%s" style="position:absolute; visibility:hidden; z-index:20; top:-999em; left:0px;"></div> 423 %s%s 424 """ % (request.cfg.url_prefix_static, formatter.make_id_unique('infodiv'), tip_js, restable) 425 return formatter.rawHTML(result)
Hope you can reproduce this error. -- 92.104.202.214 2009-01-11 22:18:30
Please try this patched version CreatePdfDocument2_3_5+p1.py and give me your feedback. Thank you for your support. -- RaphaelBossek 2009-01-12 19:31:39
thanks it works now - without an error message... another trouble is that the MonthCalendar looks horrible (compared to the pre-/htmlview), but well this is for me at the moment not the problem / case. thanks! bye -- MarcelHäfner 2009-01-12 20:39:10
v2.3.4: Traceback after changing the Title and heading 1 as title (fixed in v2.3.5)
- used MM version
- 1.8 devel
- example page
idea how to fix it
1 --- a/CreatePdfDocument.py Sun Dec 21 11:25:31 2008 +0100
2 +++ b/CreatePdfDocument.py Sun Dec 21 11:28:33 2008 +0100
3 @@ -1667,7 +1667,7 @@
4 html = html.replace (foundref[0] + foundref[1], foundref[0] + base + foundref[1])
5
6 # Rename title of the document.
7 - titletext_html = self.fixhtmlstr(wikiutil.escape(newtitle))
8 + titletext_html = self.fixhtmlstr(wikiutil.escape(self.values['titletext']))
9 html = re.compile(r'<title>[^<]+</title>').sub(u'<title>%s</title>' % titletext_html, html)
10
11 if self.values['pageinfo'] == u'unchecked':
Thank you for this bug report. If Heading 1 as title is checked but there is no heading in the document, the title from the form will be used. -- RaphaelBossek 2009-01-11 15:59:10
v2.3.4+p1: Python crashes when no user logged in and no previous cookie is present (fixed in v2.3.5)
Hi. If a user is logged in it works. If, after that, the user logs out and no user is logged in, it still works. If then the cookies for the site are cleaned, and still no user is logged in (i.e. same situation as "first user for that browser is anonymous"), it crashes with the following output. -- CristianoGozzini 2008-11-10
Thank you for this bug report. The problem seems to occurs with the CGI server. If fixed this in CreatePdfDocument2_3_4+p2.py. Please retest this version. -- RaphaelBossek 2008-11-10 20:31:17
Now (with no user logged in and cookies cleared) it raises the error: "Could not find MOIN_SESSION cookie otherwise access to ACL protected attachments is prohibited." I verified the attachments are viewable to anonymous users, and there are no user restrictions/access lists configured. -- CristianoGozzini 2008-11-11
v2.3.4: Can't use "JPEG big images" different from "None", wrong hmtldoc parameter form (fixed in v2.3.5)
Hi, with v2.3.4 I see a similar problem to "v2.3.2: Standard Input Error on standalone server (fixed in v2.3.3)", when "JPEG big images" is selected different from "None". The point seems to be the --jpeg option of htmldoc, which is required in the form --jpeg[=quality] instead of --jpeg [quality] (i.e. it lacks a "="). MoinMoin 1.7.1 with Apache2 on Ubuntu 8.10, and htmldoc 1.8.27.
htmldoc --cookies MOIN_ID=1217930306.89.54550 --no-duplex --cookies MOIN_SESSION=yc6q42uaqm40myfvk_y025tczeyjrtq4 --tocheader .t. --bottom 0.50in --header t.D --left 1.00in --linkcolor 0000E0 --headfootsize 11.0 --textcolor 000000 --size legal --pagelayout single --webpage --compression 0 --title --tocfooter ..i --charset iso-8859-1 --firstpage c1 --toclevels 3 --linkstyle underline --toctitle Indice --format pdf13 --headfootfont helvetica --fontsize 11.0 --fontspacing 1.2 --top 0.50in --headingfont helvetica --numbered --embedfonts --footer ./. --bodycolor FFFFFF --bodyfont times --browserwidth 680 --right 0.50in --pagemode outline --jpeg 100 --permission copy,print,modify,annotate -
returned:
ERR005: Unable to find "100"... PAGES: 2 BYTES: 203951
-- CristianoGozzini 2008-11-05
Thank you for this bug report. Could you please check CreatePdfDocument2_3_4+p1.py and give me an feedback if it worked for you. -- RaphaelBossek 2008-11-10 06:56:07
Hi again. If I select for example "100%", it does create a pdf now, instead of giving the aforementioned error, but the pdf has no images. It seems to be the same result as selecting "None". -- CristianoGozzini 2008-11-10
Hmm, I can not reproduce the problem on my site. Did you checked possible reasons for missing pictures "Pictures missing in PDF" by ThomasGuest? Could you please check the MoinMoin log for access denied entries? Is there a possibility for me to get access to your site to make further tests with the debug advanced option? An URL would be helpful. -- RaphaelBossek 2008-11-10 20:31:17
- I think I got it: images were .bmp! I tested with .jpg and .png images, and it works for both. Another limitation of htmldoc, I assume? Two further points:
the #!wiki caution [...] macro is not properly rendered, it just display the text but not the icon nor the surrounding box. I assumed it was something about images.
Read about "HelpOnAdmonitions" in "Troubleshooting" section. -- RaphaelBossek 2009-01-11 15:57:06
- big images are not scaled to fit the page, is there a way to enable it?
Read about "Scale/Fit big images" in "Troubleshooting" section. -- RaphaelBossek 2009-01-11 15:57:06 Thank you very much. -- CristianoGozzini 2008-11-11
v2.3.4: AttributeError thrown for anonymous users if anonymous sessions are disabled (fixed in v2.3.5)
Under the section where cookies are looked for, it is possible throw an exception on at least 1.7.2 if anonymous_session_lifetime is not set in config. The exception derives from: for cookie in self.request.headers.get('cookie', None).split(';'): which fails because there is no cookie in the header. I've made a quick fix by wrapping this in a try. Not sure if you'd prefer something more elegant, but here's a patch anyways
@@ -1765,9 +1765,13 @@ cookie = "MOIN_SESSION=" + self.request.cookie.get("MOIN_SESSION").value else: # Backward compatibility before MoinMoin 1.7 - for cookie in self.request.headers.get('cookie', None).split(';'): - if cookie[:13] == "MOIN_SESSION=": - break + try: + for cookie in self.request.headers.get('cookie', None).split(';'): + if cookie[:13] == "MOIN_SESSION=": + break + except AttributeError: + self.error_msg(u'Could not find MOIN_SESSION cookie otherwise access to ACL protected attachments is prohibited.') + return None if not cookie[:13] == "MOIN_SESSION=": self.error_msg(u'Could not find MOIN_SESSION cookie otherwise access to ACL protected attachments is prohibited.') return None
Thank you for this bug report. Could you please check CreatePdfDocument2_3_4+p1.py and give me an feedback if it worked for you. -- RaphaelBossek 2008-11-10 06:56:07
v2.3.3: extra-dynamiccodeblock-break doesn't work (fixed in v2.3.4)
It's possible to set extra-dynamiccodeblock-break: u'unchecked', in the global wiki config, but it will ignored. A good workaround is to set extra-dynamiccodeblock-breakchar: u'', instead.
Note: There is a typo in label_extra-dynamiccodeblock-break in the word "character".
CarstenGrohmann 2008-07-21 22:14:50
Thank you for this bug report. Fixed since v2.3.4. -- RaphaelBossek 2008-09-07 11:12:23
v2.3.2: Standard Input Error on standalone server (fixed in v2.3.3)
On a standalone server moin (windows XP, moin 1.7), there seems to be an issue with standard input to htmldoc. The following error message is generated (Note that generation of PDF works fine if htmldoc is called with a "real" html filename:
htmldoc --cookies MOIN_ID=1158834680.6.34914 --no-duplex --cookies MOIN_SESSION=638247fd29ed2d176c38f4b69b30f2e5 --tocheader .t. --bottom 0.50in --header t.D --left 1.00in --linkcolor 0000E0 --headfootsize 11.0 --textcolor 000000 --size legal --pagelayout single --webpage --compression 0 --title --tocfooter ..i --charset iso-8859-1 --firstpage c1 --toclevels 3 --linkstyle underline --toctitle Inhaltsverzeichnis --format pdf13 --headfootfont helvetica --fontsize 11.0 --fontspacing 1.2 --top 0.50in --headingfont helvetica --numbered --embedfonts --footer ./. --bodycolor FFFFFF --bodyfont times --browserwidth 680 --right 0.50in --pagemode outline --jpeg 0 --permission copy,print,modify,annotate -
returned:
ERR005: Unable to find "0"... ERR005: Unable to find "0"... PAGES: 2 BYTES: 157887
ThomasKieselstein 2008-07-09
Thank you for this report. This issue is fixed in v2.3.3. -- RaphaelBossek 2008-07-09 17:43:25
v2.3.1: Pictures missing for ACL protected pages (fixed in v2.3.2)
PDF documents do not contain any pictures which are attached to the page if the page is not readeable to everybody. This problem occur with MoinMoin 1.6 and newer. I'm working already on this issue. -- RaphaelBossek 2008-07-05 17:16:25
v2.3.1: Surge protection interference (fixed in MoinMoin v1.7.1)
If surge protection (HelpOnConfiguration/SurgeProtection) is enabled it may occur that you will missing pictures in your PDF document. To solve this issue FeatureRequests/SurgeProtectionOutOfServiceForLocalhostRequests was created and need a change on moin's sure protection function.
In the meantime the surge protection has to be disabled to get a valid PDF document.
v2.3.0: AttributeError (fixed in v2.3.1)
I receive an AttributeError with
'RedirectOutputRequest' object has no attribute 'output_string'
Using MoinMoin 1.7.0; see the traceback :AttributeError20080624.html
bye -- MarcelHäfner 2008-06-24 09:56:56
I've prepared a new verion for testing. Could you please install the CreatePdfDocument2_3_0+p1.py file and give me a feedback what happens. I think there is a configuration issue wich is catched in an early stage of initialisation: No wiki configuration matching the URL found! CreatePdfDocument did not expect a problem at this early stage until now. -- RaphaelBossek 2008-06-25 01:37:19
another error 'RedirectOutputRequest' object has no attribute 'form' ; see my traceback AttributeError_form.html (btw. I'm using a farmwiki in standalone mode, behind an apache/proxy)
Ok. The analysis of the code says that the initialisation fails due to a forbidden action. I've added some further checks. If I've done everything right you will see the No wiki configuration matching the URL found! error message sometime. Please try an another patch and give me a feedback: CreatePdfDocument2_3_0+p2.py -- RaphaelBossek 2008-06-25 06:51:37
Now a PDF will be generated, but with the error text "No wiki configuration matching the URL found!" (if you click to "preview". You can try it out by ourself under http://lotek.heavy.ch/PageDictsExample?action=CreatePdfDocument (maybe the problem is related that the form give the wrong url for the html view; and that's why the htmldoc shows up this error message)
Interesting is, that if you use the direct link everything works (direct link: http://lotek.heavy.ch/PageDictsExample?action=CreatePdfDocument&generate=1)
I've extended the implementation a little bit to make it possible to collect further debug informations. Please install this new version CreatePdfDocument2_3_0+p3.py. Go to expert tab and enable debuging information. Generate a PDF document (which is not) and store the HTML output here so I'm able to check it. -- RaphaelBossek 2008-06-26 16:19:10
I install it; see debug debug260208.html and it works now! thanks, ya great!
v2.3.0: Wrong Author Name (fixed in v2.3.1)
If you use the CreatePDF 2.3.0 the Authorname is displayed with self: before, like:
Self:MarcelHäfner
Using MoinMoin 1.7
bye -- MarcelHäfner 2008-06-24 09:59:29
Will be fixed in version 2.3.1. Please try CreatePdfDocument2_3_0+p1.py in the meantime. -- RaphaelBossek 2008-06-25 01:37:19
Authorname is fixed with your test release
v2.2.0: Missing UTF-8 support
I've found out another problem which you cannot solve - htmldoc does not support utf-8 encoding and by looking at current development pace, it's not very certain when it will otoh, having utf-8 suport is a must when writing manuals in different languages. -- GourD 2024-11-21 15:55:28
What about selecting the charset at the font tab. Did you tried that ? -- RaphaelBossek 2007-09-24 19:07:59
Well, utf-8 is not supported in htmldoc-1.8.x, but it's planned for 1.9 which is somewhat stalled. I found out about wikipublisher which uses latex-route. It would be nice to have support for moinmoin engine. -- GourD 2024-11-21 15:55:28
v2.2.0: Cut-off code block (fixed in v2.3.0)
Last line of a code sequence will suppressed if the closing code tab is on the last code line.
Thank you for this bug report. This problem is fixed with version 2.3.0. -- 88.66.201.203 2008-06-23 21:09:23
Examples
Line 1 of 2: Two lines normally but this line is only shown in the PDF Line 2 of 2
Line 1 of 3 line 2 of 3 line 3 of 3: This line will never shown in a PDF
Line 1 of 2: This example works fine Line 2 of 2: so it can used as a workaround
System Configuration
- Moin Moin
MoinMoin Diagnosis ====================== Release 1.5.7 Revision release Python version 2.5 (r25:51908, Feb 9 2007, 18:33:34) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-52)] Python installed to /f30fsd1/cam3/unixwiki/python-2.5 PyXML is NOT installed
- HTMLDOC
- Version 1.8.27
v2.2.0: Missing Table Borders (fixed in v2.3.0)
I had a little Problem with missing Table Borders with CreatePdfDocument.py (2.2.0). Some of the Tables looked like <table style="width: 90%"> instead of just <table>. My quick and dirty fix was to add an extra regex:
html = re.compile(r'<table>').sub(u'<table border="1" cellpadding="5">', html) # that's what I added: html = re.compile(r'<table ').sub(u'<table border="1" cellpadding="5" ', html)
It worked for me but I guess there's a better way to fix this, the Problem is I don't know any python. -- PhilippHoefflin 2008-03-03 17:30:20
Thank you for this bug report. This problem was fixed with version 2.3.0. -- RaphaelBossek 2008-06-23 21:09:23
Feature requests
Header/Footer Logo
To support HTMLDOC's "logoimage" parameter, I suggest the following patch
1 --- CreatePdfDocument2_4_2.py 2011-11-07 19:11:44.142451205 +0100
2 +++ CreatePdfDocument.py 2011-11-07 18:55:54.354441018 +0100
3 @@ -553,6 +553,7 @@
4 'tocfooterright': u'i',
5 'bodycolor': u'FFFFFF',
6 'bodyimage': u'',
7 + 'logoimage': u'',
8 'textcolor': u'000000',
9 'linkcolor': u'0000E0',
10 'size': u'legal',
11 @@ -634,7 +635,7 @@
12 u't': self._(u'Title'),
13 u'T': self._(u'Time'),
14 u'.': self._(u'Blank'),
15 - # TODO: Not supported yet; u'l': self._(u'Logo image'),
16 + u'l': self._(u'Logo image'),
17 }
18 self.valid_options[u'style'] = {
19 u'webpage': self._(u'webpage'),
20 @@ -864,6 +865,9 @@
21
22 'label_bodyimage': self._(u'Body image'),
23 'help_bodyimage': self._(u'Enter the image file for the body (background). These file has to be an attachments!'),
24 +
25 + 'label_logoimage': self._(u'Logo image'),
26 + 'help_logoimage': self._(u'Enter the image file for the header logo. This file has to be an attachments!'),
27
28 'label_textcolor': self._(u'Text color'),
29 'help_textcolor': self._(u'Enter the HTML color for the text.'),
30 @@ -1271,6 +1275,11 @@
31 <td>%(help_bodyimage)s</td>
32 </tr>
33 <tr>
34 + <td class="label"><label>%(label_logoimage)s</label></td>
35 + <td class="content"><input type="text" size="30" name="logoimage" value="%(logoimage)s" /></td>
36 + <td>%(help_logoimage)s</td>
37 + </tr>
38 + <tr>
39 <td class="label"><label>%(label_textcolor)s</label></td>
40 <td class="content"><input type="text" size="6" name="textcolor" value="%(textcolor)s" /></td>
41 <td>%(help_textcolor)s</td>
42 @@ -1819,6 +1828,8 @@
43 value = attachment_fsname(value, self.request.page, self.request)
44 elif opt == u'bodyimage':
45 value = attachment_fsname(value, self.request.page, self.request)
46 + elif opt == u'logoimage':
47 + value = attachment_fsname(value, self.request.page, self.request)
48
49 if opt in [u'style']:
50 htmldocopts += [u'--' + value]
Use of sendcache
Can you cache the created pdf file by action sendcache. I have it currently on a wiki were one creates pdf documents with 200 pages. -- ReimarBauer 2010-05-11 16:59:08 For an idea how that can be done have a look at extensions/text_x_mathtran.py#l73
No need of external HTMLDOC application
Native PDF support whould be appreciated.
Libraries to implement native PDF support for MoinMoin; prefered toolkit first:
http://www.reportlab.org/python_point.html - The ReportLab Toolkit is a cross platform Python source package. Performance can be accelerated by compiling some extra code written in C; this is recommended but not required.
http://www.jagpdf.org/ - JagPDF is a free, open source library for generating PDF documents.
MathML Support
Would it be too hard to add MathML support when creating pdf documents? I modified my local moinmoin installation to support MathML (as described in MathMlSupport ), but it does not render equations when converting to pdf. It just shows $$..some equation here ...$$. -- IgorMiletic 2024-11-21 15:55:28
On their webpage either. Let's try $$x^5$$
Additional item for page header/footer
Is it possible to add a new item for the header and footer parameter? There are title, author, date, time, chapter and so on, but I'm missing something like the name of the wiki (the wiki identity, e.g. "Wiki of department xyz") as customized via sitename-variable in 'wikiconfig.py'?
And second, is there a possibility to change the revision-number displayed on the title-page of the pdf document? I'm looking for a leading text like "Version_" or "revision number_" (both with a trailing space instead of the '_' to separate the string from the plain revision number). -- JoergUrbanski 2007-09-25
TOC with underlined links
One other suggestion: I don't think the toc in the pdf needs to be blue and underlined. People will figure out that the links are hot (besides they have the pdf bookmarks). When printed, the underlines will look ugly. Thanks! -- 216.110.85.132 2007-08-21 14:20:32
I'm sorry but this is how HTMLDOC works right now. I'm not able to change this for TOC. Maybe set the color of links to something like black would help here. But it's not a solution, I know. -- RaphaelBossek 2009-01-11 15:29:18
Print pdf from a list of pages
Good macro. Suggestion to improve: people would be print a page and his subpages.
Discussion
SinglePageSlideShow support
Do you see a chance to get this working together with the SinglePageSlideShow. Each slide on it's own pdf page? So it could become a pdf slide show. -- ReimarBauer 2006-09-29 19:35:12
To achive this in the best possible way I would prefer to use PythonPoint from ReportLab Open Source. HTMLDOC is only usefull for static pages but not for presentation where some smooth effects are needed. -- RaphaelBossek 2006-09-29 20:44:59
PDF creation of entire tree
Is there a way to generate the pdf for an entire topic and its subtopics? TWiki has an addon that does this: http://twiki.org/cgi-bin/view/Plugins/GenPDFAddOn
Using <!-- PDFSTART --> and <!-- PDFSTOP --> it's possible to define a region in TWiki's PDF generation plugin. For HTMLDOC there is no such feature yet. So for this plugin too. I will consider this idear for one of the next releases. Patches are welcome -- RaphaelBossek 2006-10-06 21:01:31
I use skip-one-region.diff to skip a fragment of HTML output (see it in action at http://wiki.mad.mw/Mercurial/NanoHowTo where the whole sidebar is omitted) I saved you 30 seconds of programming
Thank you for this patch. What should be done if someone interchange the order of start and stop ? What about multiple start-stop regions ? The name of the mark should also be changed to something more general. -- RaphaelBossek 2006-10-12 18:07:56
Wouldn't this be best achieved with the ReportLab Python PDF library aswell? Is it planned to exchange htmldoc with reportlab in the future? -- GisbertAmm 2006-11-17 09:05:22
Not from my side. Reimplementing HTMLDOC using ReportLab is not advantage for the enduser. I can be done for fun but I think it will take long time to achive the same quality as HTMLDOC has today. There are some other missing features which require my attention -- RaphaelBossek 2006-11-17 12:56:04
No doubt about that. I didn't think of re-implementing htmldoc in the first place, rather of a Wiki formatter that outputs PDF. However, it is sort of re-inventing the wheel, that's right. I was just curious. -- GisbertAmm 2006-11-17 13:04:04
Thanks Raphael for that great pdf feature! Pdf support was indeed missing in Moin. I do also think normal users are more likely to generate a copy of a wikipage in pdf than docbook. The only advantage I see in reimplementing pdf generation with ReportLab in Python is maybe, that pdf generation than will become a built-in-standard feature of Moin with it's own menu item, which does not need an extra setup or downloading and hopefully correct compiling of source codes. That's a problem for me, since at the moment, I do not have a c compiler installed on my system. I have to ask someone to give me a hand in compiling htmldoc. -- OliverSiemoneit 2006-11-17 14:12:30
Does the PdfAction now have the feature of creating PDFs of a whole tree or a chain of subpages? I see that the discussion above is from 2006. This would really a nice feature. Is there a workaround do do this? -- RalfGroß 2010-11-19 11:16:34
- Not yet and I do not know if ever. I did not spend one minute thing about how to implement this new feature. There are questions which need an answer:
- How/Who define which pages should be generated ? (Thing about this two minutes and you will see it's not as simple as it may sound in the first second)
- Starting multiple downloads within one HTTP session is not supported so the generated PDFs should be stored in one ZIP for download.
Open for suggestions and idears. -- RaphaelBossek 2010-11-19 14:22:31
- Not yet and I do not know if ever. I did not spend one minute thing about how to implement this new feature. There are questions which need an answer:
Change HTMLDOC defaults in CreatePdfDocument form
I'd like to change some of the defaults within the form. E.g. the paper size should be set to A4 for us instead of US Letter and the language to de_DE instead of en_US (IIRC). How can this be achieved? BTW: Shouldn't the language be taken from the browser settings? -- GisbertAmm 2006-11-17 09:10:36
All CreatePdfDocument form default values can be set to alternative default values. Define the createpdfdocument_defaultvalues dictionary wihtin your conifugration file like in this example:
createpdfdocument_defaultvalues = {u'size': u'a4', u'language': u'de_DE'}
You have to know that the value of language will be to the value of #langauge defined on the site. For a overview of all definitions search withint the sources for self.default_values. Which values are valid is stored withtin an another dictionary called self.valid_options. Search for both if you like to change these. Sorry that I do not describe this more detailed on this side. I think I won't be able to keep this in sync over the time long. -- RaphaelBossek 2006-11-17 12:39:20
How do I change the default format from book to webpage? I tried u'style': u'webpage' in the config but that has no effect. -- GisbertAmm 2006-11-21 13:21:41
Sorry for this late answer (but I did not found your question). This problem is fixed in v2.4.3 or newer. Set createpdfdocument_defaultvalues = {u'style': u'webpage'} in your wiki configuration file as default value. -- RaphaelBossek 2008-11-10 20:41:23
Troubleshooting
Pictures missing in PDF
When I greate a attachment:image008.jpg the picture will not be in the pdf document, when I use a externel link I have that picture in the pdf? -- AndreVanWeert
- To find the problem process with following steps:
Start CreatePdfDocument in debug mode, e.g. http://www.solutions4linux.de/wiki/FrontPage?action=CreatePdfDocument&generate=1&debug=1
- Check if the images are there and save the HTML page together with all related files on you harddisk. The borwser will relink everythink to your local directory structure so there is not internet connection needed to view the HTML document.
Start htmldoc --continuous myhtmlpage.html at your console and check the generated PDF document.
If the result is as you expect please make a new request without &debug=1 and check yours web server access log if the picture's URL is refered.
Give me a feedback about your investigation. -- RaphaelBossek 2006-10-07 15:58:40
The error "You are not allowed to view this page" made me to change my #acl AdminGroup:admin,read,write to #acl AdminGroup:admin,read,write All:read. Now there was no error, and when I make a PDF the image is in the PDF if I change my ACL back to #acl AdminGroup:admin,read,write it is gone. The strange thing is everything else is in the document but not the image, so why do I need All:read for an image? -- AndreVanWeert
Which version of HTMLDOC are you using ? It's important to use 1.8.25 or newer to get acces for ACL protected pages. ActionMarket/PdfAction uses your MOIN ID to create a cookie for the access to the page as it will be you. Otherwise you get access denied. -- RaphaelBossek 2006-10-08 18:30:05
That Would be the case for my problem then, I use freebsd en just installed it from the port collection. I now see that the port collection version is;1.8.23, I will compile the last version by hand. Thanx for the help and information. -- AndreVanWeert 2006-10-08 22:42:05
Pictures missing in PDF (part 2)
If you're behind a NATting firewall, you'll get only PDFs without pictures. And due to timeouts this will take quite some time.
Here is a workaround for this problem (for Linux - sorry, I have no clue how to set up an IP alias on Windows): If you're accessing your MoinMoin wiki via IP address (e.g. http://211.23.145.33/moin/PrintThat) then just establish the external address as second IP address for your NIC.
E.g. Your external address is: 211.23.145.33 and your internal: 192.168.44.27
As root add a second IP address: /sbin/ifconfig eth0:0 211.23.145.33
Add a route: /sbin/route add -host 211.23.145.33 dev eth0:0
Adjust the apache settings accordingly:
<VirtualHost 211.23.145.33:80 192.168.44.27:80>
This should give you pictures in PDFs behind firewalls.
-- ThomasGust 2007-07-04 12:49:31
Pictures missing in PDF (part 3)
We use Apache NTLM authentication. The action does not know about this and can not reproduce the login, so htmldoc is not able to retrieve images. To solve this issue, I added the following to Apache's config:
<Location /mywiki> Allow from mywiki.company.com Satisfy any ... (other auth lines here) </Location>
Now requests from the local machine (such as from htmldoc) are allowed. Adjust hostname as appropriate. -- 134.134.136.4 2007-08-20 17:18:08
Won't work in my setup?! If I'm puting these lines into the apache config the Kerberos auth stopped working in the browser and I only get an access denied in the wiki (All: attribute is set in the wiki, only known users are allowed to read/write). -- 213.23.91.62 2011-06-29 11:54:19
Pictures missing in PDF (part 4) (applied in v2.3.2)
In the rare case that your server needs a http proxy to access pictures in your document you need to patch CreatePdfDocument.py
E.g. you want to pdf a page which contains {{http://code.google.com/opensource/ghop/2007-8/images/ghoplogo.jpg}} but due to a firewall the server(!) (i.e. dochtml) needs to use a proxy to access the picture link.
To solve this add a proxy key with the http://IPADDRESS:PORT-value to createpdfdocument_defaultvalues in your wikiconfig.py:
# PDF creation options ---------------------------------------------- createpdfdocument_defaultvalues = {u'size': u'a4', u'language': u'fi_FI', u'proxy': u'http://192.168.44.250:3128' }
In CreatePdfDocument.py add the 2 lines as depicted below:
1 def html2pdf(self, html):
2 """Create a PDF document based on the current parameters."""
3 # Set environment variables for HTMLDOC
4 os.environ['LANG'] = self.values[u'language']
5 os.environ['HTMLDOC_NOCGI'] = '1'
6 # Determine UID to access ACL protected sites too (mandatory to download attached images).
7 htmldocopts = [self.default_values['htmldoc_cmd'], "--cookies", "MOIN_ID=" + self.request.user.id, u'--no-duplex']
8
9 for key in [u'header', u'footer', u'tocheader', u'tocfooter']:
10 self.values[key] = self.values.get(key + u'left', u'.') + self.values.get(key + u'middle', u'.') + self.values.get(key + u'right', u'.')
11
12 ### add these 2 lines below
13 if u'proxy' in self.default_values:
14 htmldocopts += [u'--proxy', self.default_values[u'proxy']]
15
16 permissions = []
17 for opt, value in self.values.items():
Now restart your web server, the problem should be solved. This might outdate Pictures missing in PDF (part 2) if you have a proxy in place. -- ThomasGust 2008-07-02 14:38:40
New Page Tag
It would be nice to have something like a <!-- PDFA4 --> so the PDF creator starts at a new page, the document layout would look nicer if you create a PDF from the html source.
Install the PDFControl macro to control the PDF processor. To create a new page write [[PDFControl(NEW PAGE)]] into your wiki site. Please refer to HTMLDOC's documentaion as mentioned before. -- RaphaelBossek 2006-10-09 18:17:39
Using the Frame macro
not sure if it's a PDFAction bug
I'm using the Frame parser and when I generate a PDF, It doesn't really work. When I create a Frame of width 20%, background color red and alignment on the right, in the PDF file, I have a frame of width 20%, color red, but aligned on the left. -- EricVeirasGalisson
The Frame parser uses CSS which are not supported by HTMLDOC. Which HTML elements HTMLDOC supports can be found here http://www.htmldoc.org/documentation.php/GeneralUsage.html. -- RaphaelBossek 2009-01-11 15:29:18
"Book" style skips text before Heading 1 (works as designed)
Hi, if the style "book" is chosen, any text before the first heading is not included in the pdf (while fox example with "continuous" style it's correctly included). MoinMoin 1.7.1 with Apache2 on Ubuntu 8.10, and htmldoc 1.8.27.
-- CristianoGozzini 2008-11-06
That is by design. This allows having table of contents - and other information that is only relevant when browsed from an HTML browser, e.g. links - not to interfere with the PDF output. Table of contents with proper page numbers is solved by HTMLDOC during the export.
This should be kept this way. - 2008-11-08
You write Have at least one heading. My suggestion: Take the title of the page as H1 if none exists. -- ThiloPfennig 2006-09-13 08:59:37
It's a disadvantage of HTMLDOC: http://www.htmldoc.org/documentation.php/Overview.html I do not like to workarround this. Please introduce yourself a heading. -- RaphaelBossek 2008-11-10 06:56:07
Ok, I see your point. Thank you. -- CristianoGozzini 2008-11-10
In listings eol sign unwanted
How can I remove the eol char?
You can switch it off in the Extra config section "Use a para character for line breaks".
output big images
I have big png images why is JPEG handled different to other image files?
HelpOnAdmonitions
HelpOnAdmonitions uses uses CSS which are not supported by HTMLDOC. Which HTML elements HTMLDOC supports can be found here http://www.htmldoc.org/documentation.php/GeneralUsage.html. -- RaphaelBossek 2009-01-11 15:29:18
Scale/Fit big images
To fit big images to your page site exists three solutions:
You can use the Browser width setting at Page tab. Set here the width of your images (max 1200) to scale them down to fit page borders.
Flip the page with the PDFControl macro. Put your image in between of <<PDFControl(MEDIA LANDSCAPE YES)>> and <<PDFControl(MEDIA LANDSCAPE NO)>>
Change the size of you page with the PDFControl macro. Put your image in between of <<PDFControl(MEDIA SIZE A3)>> and <<PDFControl(MEDIA SIZE A4)>>
-- RaphaelBossek 2009-01-11 15:57:06 -- ReimarBauer 2010-09-14 07:09:38
problems
The current version copies all MOIN_SESSION_* cookies of a browser to the htmldoc cmdstr. It should select the one of the wiki. e.g.
MOIN_SESSION_8081_ROOT MOIN_SESSION_8080_ROOT
ideas
instead of self.request.form['action'] = ['print'] you can may be use self.request.form['action'] = ['content'] and define the header, without the need to replace or insert something