http://trac-hacks.org/wiki/TracWikiToPdfPlugin : Images won't find their way to the PDF

132 views
Skip to first unread message

Ice Polar

unread,
Mar 3, 2009, 12:38:07 PM3/3/09
to trac-...@googlegroups.com
Hi there,

i've installed the WikiToPDF-Plugin from http://trac-hacks.org/changeset/latest/tracwikitopdfplugin?old_path=/&filename=tracwikitopdfplugin&format=zip on my trac 0.11.4 instance on ubuntu 8.04.2. It's a single instance running with apache2, no big thing.
Trac project is located at /var/trac/wiki. I have copied the cover folder to /var/trac/wiki/cover.  The parameter  logoimage = /var/trac/wiki/htdocs/Header_image.png works fine.

Now i have some questions about the configuration of trac.ini, yellow marked, because images won't find their way to the pdf :

[components]
wikitopdf.* = enabled

[wikitopdf]
# base_dir is the Apache DocumentRoot, It is need to get PDF files with images.
base_dir = /path/to/DocumentRoot

# path to folder used to get a cover files. (key corrected from pathtocover to titlefile)
titlefile = /path/to/cover

# this are parameters functionality PDF links
link = http://servername/trac-project
folder_name = trac-project

[wikitopdf-admin]
# HTMLDOC options. See the link above.
size = A4
right = 1.5cm
left = 1.5cm
top = 1.5cm
bottom = 1.5cm
no-links = None
toctitle = Summary
numbered = None
linkstyle = plain
header = l
footer = .r1
logoimage = /var/trac/wiki/htdocs/Header_image.png

[wikitopdf-page]
# HTMLDOC options. See the link above.
size = A4
right = 1.5cm
left = 1.5cm
top = 1.5cm
bottom = 1.5cm
no-links = None
linkstyle = plain
header = l
footer = .r1
logoimage = /var/trac/wiki/htdocs/Header_image.png

Trac.log show's some Informations which i can't figure out, i put three images on a wiki side (i killed the unimportant lines), the third image is not proper 'wiki'-coded (that's ok):

2009-03-03 17:59:47,993 Trac[wikitopdf] DEBUG: WikiToPdf => Start function wiki_to_pdf
2009-03-03 17:59:47,994 Trac[wikitopdf] DEBUG: WikiToPdf => Wiki intput for WikiToPdf: u' .... * 1.\r\n[[Image(wiki:TicketSystem:basic-workflow.png)]]\r\n\r\n * 2.\r\n[[Image(TicketSystem:basic-workflow.png)]]\r\n\r\n * 3.\r\n[[Image(basic-workflow.png)]]\r\n\r\n\r\n----...'
2009-03-03 17:59:47,996 Trac[api] DEBUG: Updating wiki page index
2009-03-03 17:59:48,034 Trac[formatter] DEBUG: Executing Wiki macro Image by provider <trac.wiki.macros.ImageMacro object at 0x8b9fd2c>
2009-03-03 17:59:48,038 Trac[formatter] DEBUG: Executing Wiki macro Image by provider <trac.wiki.macros.ImageMacro object at 0x8b9fd2c>
2009-03-03 17:59:48,040 Trac[formatter] DEBUG: Executing Wiki macro Image by provider <trac.wiki.macros.ImageMacro object at 0x8b9fd2c>
2009-03-03 17:59:48,041 Trac[formatter] ERROR: Macro Image(basic-workflow.png) failed:
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/wiki/formatter.py", line 480, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/wiki/formatter.py", line 180, in process
    text = self.processor(text)
  File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/wiki/formatter.py", line 167, in _macro_processor
    text)
  File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/wiki/macros.py", line 425, in expand_macro
    if attachment and 'ATTACHMENT_VIEW' in formatter.perm(attachment):
  File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/perm.py", line 524, in has_permission
    return self._has_permission(action, resource)
  File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/perm.py", line 538, in _has_permission
    check_permission(action, perm.username, resource, perm)
  File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/perm.py", line 433, in check_permission
    (username, action, resource))
  File "/usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/resource.py", line 111, in __repr__
    return '<Resource %r>' % (', '.join(reversed(path)))
TypeError: sequence item 0: expected string, NoneType found

2009-03-03 17:59:48,044 Trac[formatter] DEBUG: Executing Wiki macro Timestamp by provider <Timestamp.TimestampMacro object at 0x8b9fb2c>
2009-03-03 17:59:48,045 Trac[wikitopdf] DEBUG: WikiToPdf => HTML output for WikiToPdf in charset iso-8859-15 is: '<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15"/></head><body><p>\n<a class="wiki" href="http://localhost/trac/wiki/WikiStart">...<li>1.\n</li></ul><p>\n<a style="padding:0; border:none" href="/trac/attachment/wiki/TicketSystem/basic-workflow.png"><img border="0" src="/trac/raw-attachment/trac/attachments/wiki/TicketSystem/basic-workflow.png" alt="Trac Ticket Workflow" title="Trac Ticket Workflow" /></a>\n</p>\n<ul><li>2.\n</li></ul><p>\n<a style="padding:0; border:none" href="/trac/attachment/wiki/TicketSystem/basic-workflow.png"><img border="0" src="/trac/raw-attachment/trac/attachments/wiki/TicketSystem/basic-workflow.png" alt="Trac Ticket Workflow" title="Trac Ticket Workflow" /></a>\n</p>\n<ul><li>3.\n</li></ul><p>\n<div class="system-message"><strong>Error: Macro Image(basic-workflow.png) failed</strong><pre>sequence item 0: expected string, NoneType found</pre></td></tr></table></div>\n</p>\n<hr />\n<p>...\n</p>\n</body></html>'
2009-03-03 17:59:48,046 Trac[wikitopdf] DEBUG: WikiToPdf => Finish function wiki_to_pdf
2009-03-03 17:59:48,046 Trac[wikitopdf] DEBUG: WikiToPdf => Start function html_to_pdf
2009-03-03 17:59:48,047 Trac[wikitopdf] DEBUG: WikiToPdf => Htmldoc command line: htmldoc --footer .r1 --right 1.5cm --no-links None --format pdf14 --webpage  --top 1.5cm --charset iso-8859-15 --bottom 1.5cm --logoimage /var/trac/wiki/htdocs/Header_image.png --header l --left 1.5cm --linkstyle plain --size A4 /tmp/tmp1sVwmCwikitopdf -f /tmp/tmp8YTusZwikitopdf
2009-03-03 17:59:48,172 Trac[wikitopdf] DEBUG: WikiToPdf => Finish function html_to_pdf
2009-03-03 17:59:48,247 Trac[main] DEBUG: 394 unreachable objects found.

As one can see the images 1 and 2 were processed the same way, image 3. throws an error, but none of the images are shown in the resulting pdf-file.
I believe in that there is an issue with the path's in trac.ini or somewhere else.

Is there somebody who can help?

Thx
  Ice

yoheeb

unread,
Mar 3, 2009, 6:29:23 PM3/3/09
to Trac Users
On Mar 3, 11:38 am, Ice Polar <ice.po...@gmail.com> wrote:
> Hi there,
>
> i've installed the WikiToPDF-Plugin fromhttp://trac-hacks.org/changeset/latest/tracwikitopdfplugin?old_path=/...
> my trac 0.11.4 instance on ubuntu 8.04.2. It's a single instance
> running
> with apache2, no big thing.
> Trac project is located at /var/trac/wiki. I have copied the cover folder to
> /var/trac/wiki/cover.  The parameter  logoimage =
> /var/trac/wiki/htdocs/Header_image.png
> works fine.
<snip>

Well, I have not even looked at the wikitopdf plugin code. however,
it looks like your images are page attachements. (by your "[[Image]]
macros in the debug/error codes.

I also see this line in the ini file you provided:
[wikitopdf]
# base_dir is the Apache DocumentRoot, It is need to get PDF files
with
images.
base_dir = /path/to/DocumentRoot

and this is clearly not your Apache htdocs directory. of course you
may of obfuscated it.

based on the comment, I get the impression for the WikiToPDF plugin,
you would need to put a copy of the image files in your Apache
document root in order for the HTMLDoc tool to pick them up insert
them into the temporary documents that are fed to the other python/PIL
tools to create a PDF.

Outside of that, I did notice that "failed" image was referenced
unqualified in the image macro, which is valid for trac, but might be
a limitation or bug in the wiki-to-pdf plugin. It could also be that
the fact that 1 image failed, they all failed and the resultant PDF
file was only fed the html that was extracted from the wiki.

to eliminate this last, remote possibility, I would consider changing
that "failed" image macro to pass and see what happens. I suspect
your images will still be missing because of something else, possibly
the first observation, or your base_url for the trac site iteself,
etc.

of course, it could also be something complete different. It's miller
time here, I am out of brainpower. Good luck.

Ice Polar

unread,
Mar 4, 2009, 5:18:51 AM3/4/09
to trac-...@googlegroups.com
Hi,

thanks for replying.
It is definitvely not a problem of the third image which throws an error. Without this third image the Log looks like this (the working things are snipped out):

[trac.log]
2009-03-04 10:50:21,760 Trac[wikitopdf] DEBUG: WikiToPdf => Start function wiki_to_pdf
2009-03-04 10:50:21,760 Trac[wikitopdf] DEBUG: WikiToPdf => Wiki intput for WikiToPdf: ... * 1.\r\n[[Image(wiki:TicketSystem:basic-workflow.png)]]\r\n\r\n * 2.\r\n[[Image(TicketSystem:basic-workflow.png)]]\r\n\r\n * 3.\r\n\r\n{{{\r\n[[Image(basic-workflow.png)]]\r\n}}}\r\n\r\n\r\n\r\n...'
2009-03-04 10:50:21,762 Trac[api] DEBUG: Updating wiki page index
2009-03-04 10:50:21,797 Trac[formatter] DEBUG: Executing Wiki macro Image by provider <trac.wiki.macros.ImageMacro object at 0x8ca3d6c>
2009-03-04 10:50:21,800 Trac[formatter] DEBUG: Executing Wiki macro Image by provider <trac.wiki.macros.ImageMacro object at 0x8ca3d6c>
2009-03-04 10:50:21,806 Trac[formatter] DEBUG: Executing Wiki macro Timestamp by provider <Timestamp.TimestampMacro object at 0x8ca3aec>
2009-03-04 10:50:21,808 Trac[wikitopdf] DEBUG: WikiToPdf => HTML output for WikiToPdf in charset iso-8859-15 is: '<html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15"/></head><body>...<ul><li>1.\n</li></ul><p>\n<a style="padding:0; border:none" href="/trac/attachment/wiki/TicketSystem/basic-workflow.png"><img border="0" src="/trac/raw-attachment/trac/attachments/wiki/TicketSystem/basic-workflow.png" alt="Trac Ticket Workflow" title="Trac Ticket Workflow" /></a>\n</p>\n<ul><li>2.\n</li></ul><p>\n<a style="padding:0; border:none" href="/trac/attachment/wiki/TicketSystem/basic-workflow.png"><img border="0" src="/trac/raw-attachment/trac/attachments/wiki/TicketSystem/basic-workflow.png" alt="Trac Ticket Workflow" title="Trac Ticket Workflow" /></a>\n</p>\n<ul><li>3.\n</li></ul><table align="center" width="95%" border="1" bordercolor="#d7d7d7"><tr><td bgcolor="#f7f7f7"><pre class="wiki">[[Image(basic-workflow.png)]]\n</pre></td></tr></table><hr />\n...</body></html>'
2009-03-04 10:50:21,809 Trac[wikitopdf] DEBUG: WikiToPdf => Finish function wiki_to_pdf
2009-03-04 10:50:21,809 Trac[wikitopdf] DEBUG: WikiToPdf => Start function html_to_pdf
2009-03-04 10:50:21,810 Trac[wikitopdf] DEBUG: WikiToPdf => Htmldoc command line: htmldoc --footer .r1 --right 1.5cm --no-links None --format pdf14 --webpage  --top 1.5cm --charset iso-8859-15 --bottom 1.5cm --logoimage /var/trac/wiki/htdocs/Header_image.png --header l --left 1.5cm --linkstyle plain --size A4 /tmp/tmp3Wn1Wfwikitopdf -f /tmp/tmpqKu7kQwikitopdf
2009-03-04 10:50:21,931 Trac[wikitopdf] DEBUG: WikiToPdf => Finish function html_to_pdf

These yellow marked paths in the Log look strange for me. Is there e an interrelation between them and the trac.ini entries?

[trac.ini]
[wikitopdf]
base_dir = /trac/raw-attachment
folder_name = trac
link = http://localhost/trac
pathtocover = /var/trac/wiki/cover
titlefile = /var/trac/wiki/cover

[wikitopdf-admin]
bottom = 1.5cm
footer = .r1
header = l
left = 1.5cm
linkstyle = plain
logoimage = /var/trac/wiki/htdocs/Header_image.png
no-links = None
numbered = None
right = 1.5cm
size = A4
toctitle = Summary
top = 1.5cm

[wikitopdf-page]
bottom = 1.5cm
footer = .r1
header = l
left = 1.5cm
linkstyle = plain
logoimage = /var/trac/wiki/htdocs/Header_image.png
no-links = None
right = 1.5cm
size = A4
top = 1.5cm

And /etc/apache2/sites-available/trac looks like this:

<Location /trac>
   SetHandler mod_python
   PythonHandler trac.web.modpython_frontend
   PythonPath "sys.path + ['/usr/share/trac']"
   PythonOption TracEnv /var/trac/wiki
   PythonOption TracUriRoot /trac
   AuthType Basic
   AuthName "Trac"
   AuthUserFile /etc/apache2/trac.passwd
#   Require valid-user
</Location>

Any suggestions about that issue?

  Ice





2009/3/4 yoheeb <yoh...@gmail.com>

yoheeb

unread,
Mar 5, 2009, 2:07:51 PM3/5/09
to Trac Users
On Mar 4, 4:18 am, Ice Polar <ice.po...@gmail.com> wrote:
> Hi,
>
> thanks for replying.
> It is definitvely not a problem of the third image which throws an error.
> Without this third image the Log looks like this (the working things are
> snipped out):
> These yellow marked paths in the Log look strange for me. Is there e an
> interrelation between them and the trac.ini entries?
You realize this is an email list right? I don't get anything marked
yellow
>
> [trac.ini]
> [wikitopdf]
> base_dir = /trac/raw-attachment
> folder_name = trac

I still think these settings are incorrect.
[wikitopdf]
# base_dir is the >>>>>>>Apache DocumentRoot<<<<<<<, It is need to get
PDF files with images.

my apache document root is:
on my system is c:/bin/tools/Apache2.2/htdocs
since I installed apache 2.2 on c:/bin/tools

the folder_name parameter seems to be meant to work with the link
paramater, which is used for links inside the pdf to get absolute
URLs, which you don't seem to have entered.
seems like you "expect" the directory to place/fetch images to be /
trac/raw-attachment/trac but that is not how/what these parameters
are used for.

Now, I gleaned all this information from a quick glance at the
wikitopdf trac-hacks page, I don't even use the tool. Did you READ
this?

sorry, but you have to do some of the work here, more importantly you
need to slow down and work through this methodically.

Ice Polar

unread,
Mar 5, 2009, 4:38:28 PM3/5/09
to trac-...@googlegroups.com
Hi,

Yes i read the instructions on trac-hacks page and yes you are right, i'm looking for "/path/to/DocumentRoot " namely on a ubuntu 8.04.

Again, i put  images on a wikiside like this (recomended by trac-hacks):
 * 1.
[[Image(wiki:TicketSystem:basic-workflow.png)]]

 * 2.
[[Image(TicketSystem:basic-workflow.png)]]

* 3.
{{{ [[Image(basic-workflow.png)]] }}}

The third syntax is not suported so i marked it als code and so it throws no more error.

The  huge log-Output should show the somehow weird paths for both pictures like src="/trac/raw-attachment/trac/attachments/wiki/TicketSystem/basic-workflow.png" and href="/trac/attachment/wiki/TicketSystem/basic-workflow.png".
None of both exists on the system, absolutely the Image-file lies under /var/trac/wiki/attachments/wiki/TicketSystem/basic-workflow.png . This path is the trac standard-path for wiki-attachments.

On the other hand i find the following working on a wiki-side:
{{{
#!html
<h1 style="text-align: right; color: red">MyWiki</h1>
</p><div class="wiki-toc"><img src="/trac/raw-attachment/wiki/LinuxWorld/zayno-urahara-kisuke-tux-15268.png" width=250 height=250 ><p>
}}}
while the image is located at path to /var/trac/wiki/attachments/wiki/LinuxWorld/zayno-urahara-kisuke-tux-15268.png

At least the study of Ticket #3590 on trac-hacks couldn't clear the things.

sincerely
  Ice



2009/3/5 yoheeb <yoh...@gmail.com>

Ice Polar

unread,
Mar 5, 2009, 7:15:47 PM3/5/09
to trac-...@googlegroups.com
Hi,

i got a solution for my trac 0.11.3 ubuntu 8.04 apache2 single project installation to run the WikiToPDF-Plugin with the images show up.
First of all i set in file: /etc/apache2/sites-available/trac

<Location /trac>
   SetEnv TRAC_ENV "/var/trac/wiki"

   SetHandler mod_python
   PythonHandler trac.web.modpython_frontend
   PythonPath "sys.path + ['/usr/share/trac']"
   PythonOption TracEnv /var/trac/wiki
   PythonOption TracUriRoot /trac/wiki

   AuthType Basic
   AuthName "Trac"
   AuthUserFile /etc/apache2/trac.passwd
#   Require valid-user
</Location>

The following parameter from PythonOption TracUriRoot /trac to PythonOption TracUriRoot /trac/wiki

Then in file : /var/trac/wiki/conf/trac.ini
[wikitopdf]
base_dir = /var
folder_name = trac
link = http://localhost/trac/wiki

pathtocover = /var/trac/wiki/cover
titlefile =

the parameter base_dir is set to  /var

I've tested the following Image-Macro's in some wiki-sides:
1 .[[Image(wiki:TicketSystem:basic-workflow.png)]]

2.[[Image(TicketSystem:basic-workflow.png)]]

3.[[Image(basic-workflow.png)]]

The first two are working the thrid throws an error-print-out in the PDF.

sincerely
  Ice




2009/3/5 yoheeb <yoh...@gmail.com>

Ice Polar

unread,
Mar 8, 2009, 4:08:46 PM3/8/09
to trac-...@googlegroups.com
Hi,

My posted solution has a disadvantage: Apache2 error.log shows:

[Sun Mar 08 20:34:14 2009] [error] [client 127.0.0.1] ValueError: TracUriRoot set to /trac/wiki but request URL is /trac/raw-attachment/wiki/BilderRepository/Ubuntu_Zertifikat.png, referer: http://localhost/trac/wiki/wiki/WikiStart

This and the fact that the following Picture is missing:

{{{
#!html
</p><div class="wiki-toc"><img src="/trac/raw-attachment/wiki/BilderRepository/Ubuntu_Zertifikat.png" width=300 height=250><p>
}}}

The entry in the error.log follows the request of the appropriate side.

Now should i set the "PythonOption TracUriRoot /trac/wiki" in /etc/apache2/sites-available/trac  back to "PythonOption TracUriRoot /trac" to have my picture to show up or should i leave my change and have the WikiToPDF-Plugin working?

And, on annother similar trac Installation where the plugin http://trac-hacks.org/wiki/PageToPdfPlugin is installed, the change on "PythonOption TracUriRoot" is not necessary for having the Pictures with [[Image(wiki:file)]] (the short form [[Image(file)]] doesn't work) in the PDF-Download!

There musst be an error in the path's of WikiToPDF-Plugin i think, but can't find out where to look.

sincerely
  Ice

 



2009/3/6 Ice Polar <ice....@gmail.com>

Olemis Lang

unread,
Mar 9, 2009, 9:16:32 AM3/9/09
to trac-...@googlegroups.com
On Sun, Mar 8, 2009 at 3:08 PM, Ice Polar <ice....@gmail.com> wrote:
> Hi,
>
> My posted solution has a disadvantage: Apache2 error.log shows:
>
> [Sun Mar 08 20:34:14 2009] [error] [client 127.0.0.1] ValueError:
> TracUriRoot set to /trac/wiki but request URL is
> /trac/raw-attachment/wiki/BilderRepository/Ubuntu_Zertifikat.png, referer:
> http://localhost/trac/wiki/wiki/WikiStart
>
[...]

>
> Now should i set the "PythonOption TracUriRoot /trac/wiki"

Why not "PythonOption TracUriRoot /trac" ?

PD: Excuse me if this is a naïve question, probably I am missing
something you have already said ... but «TracUriRoot» should not be
set to a path inside the env's root path ... AFAICR ...

--
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Filmes que van más allá ... Brainstorm + Los Dioses Rotos

ice....@gmail.com

unread,
Mar 12, 2009, 7:23:33 PM3/12/09
to Trac Users
Hello,

as i said last time. It's not working proper with "PythonOption
TracUriRoot /trac/wiki".
@Olemis: you are right, "PythonOption TracUriRoot /trac" is it that
must be.

But that way the Macro [[Image(wiki:filename)]] cannot be transformed
into PDF by the WikiToPDF-Plugin.

I insepcted Trac's macro.py but can't figure out what to change to
make the Macro [[Image(filename)]] with the WikiToPDF working as
mentioned.
Also i tried to have a alook at the WikiToPDF-Plugin to find a way to
fix this path-a-magic.

Both tries failed, i stuck here with a pair of loose ends.

Sorry to bother you again.

sincerely
Ice


On Mar 9, 2:16 pm, Olemis Lang <ole...@gmail.com> wrote:

Olemis Lang

unread,
Mar 13, 2009, 8:23:02 AM3/13/09
to trac-...@googlegroups.com
On Thu, Mar 12, 2009 at 6:23 PM, <ice....@gmail.com> wrote:
>
> Hello,

Hi there ...

> as i said last time. It's not working proper with "PythonOption
> TracUriRoot /trac/wiki".
> @Olemis: you are right,  "PythonOption TracUriRoot /trac" is it that
> must be.
>
> But that way the Macro [[Image(wiki:filename)]] cannot be transformed
> into PDF by the WikiToPDF-Plugin.
>
> I insepcted Trac's macro.py but can't figure out what to change to
> make the Macro [[Image(filename)]] with the WikiToPDF working as
> mentioned.
> Also i tried to have a alook at the WikiToPDF-Plugin to find a way to
> fix this path-a-magic.
>

Ok ... Let's see what I can do ... ;)

> Sorry to bother you again.
>

That's what we are here for ... ;)

--
Regards,

Olemis.

Featured article:
Click y al Sur : Amanecer feliz ...

ice....@gmail.com

unread,
Mar 25, 2009, 5:44:53 PM3/25/09
to Trac Users
Hi Olemis,

Is there a chance to get that WikiToPdf-Macro fixed?
I stuck here and don't know how to come out, please help.

Thx
Ice


On Mar 13, 1:23 pm, Olemis Lang <ole...@gmail.com> wrote:
> On Thu, Mar 12, 2009 at 6:23 PM,  <ice.po...@gmail.com> wrote:
>
> > Hello,
>
> Hi there ...
>
> > as i said last time. It's not working proper with "PythonOption
> > TracUriRoot /trac/wiki".
> > @Olemis: you are right,  "PythonOption TracUriRoot /trac" is it that
> > must be.
>
> > But that way the Macro [[Image(wiki:filename)]] cannot be transformed
> > into PDF by theWikiToPDF-Plugin.
>
> > I insepcted Trac's macro.py but can't figure out what to change to
> > make the Macro [[Image(filename)]] with theWikiToPDFworking as
> > mentioned.
> > Also i tried to have a alook at theWikiToPDF-Plugin to find a way to

Olemis Lang

unread,
Mar 26, 2009, 8:14:43 AM3/26/09
to trac-...@googlegroups.com
On Wed, Mar 25, 2009 at 4:44 PM, <ice....@gmail.com> wrote:
>
> Hi Olemis,
>

Hi ...

> Is there a chance to get that WikiToPdf-Macro fixed?
> I stuck here and don't know how to come out, please help.
>

I installed the plugin and tried it ... and the only thing I can say
so far is that I experience similar problems with images ... but I
dont get to find out what is all that about (a bug / a wrong config /
,,,)

I'll keep trying to fix it ... and I'll let you all know ... ;) but
there is no much I can say right now ... sorry ... :(

> Thx
>  Ice
>

:)

Álvaro J. Iradier

unread,
Mar 26, 2009, 9:19:13 AM3/26/09
to trac-...@googlegroups.com
I'm working on a fork of WikiToPDF using xhtml2pdf/PISA[1] python
libraries instead of using an external application (HTMLDOC).

If anyone is interested, I'll register the plugin, I started working
on it, but didn't have time in the last days.

The plugin works, and adds 2 new formats: PDF Document, and PDF Book.
PDF Document includes TOC only if page uses [PageOutline] macro. PDF
book always adds a front page and a TOC. Combining many pages is also
supported.

What is missing right now is:

* Header and front page are fixed in code (just for testing). Need to
add some options
* CSS page is fixed (it uses the xhtml2pdf default, with some changes
hard-coded to make the TOC better), and the admin option to select CSS
is not working.
* Bug fixes and improvements.

Greets.

[1] http://www.xhtml2pdf.com/
--
Álvaro J. Iradier Muro
Departamento de Desarrollo
alvaro....@polartech.es

Polar Technologies
T +34 976 527 952
F +34 976 466 125
www.polartech.es

Antes de imprimir este mensaje, por favor, compruebe que es verdaderamente
necesario. El medioambiente es cosa de todos.

AVISO LEGAL
Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener
información confidencial, siendo para uso exclusivo del destinatario,
quedando prohibida su divulgación, copia o distribución a terceros sin la
autorización expresa del remitente. Si Vd. ha recibido este mensaje
erróneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboración.

W. Martin Borgert

unread,
Mar 26, 2009, 2:24:48 PM3/26/09
to trac-...@googlegroups.com, Álvaro J. Iradier
Quoting "Álvaro J. Iradier" <alvaro....@polartech.es>:
> I'm working on a fork of WikiToPDF using xhtml2pdf/PISA[1] python
> libraries instead of using an external application (HTMLDOC).

This sounds like a good idea. I wonder, whether this solution
(based on reportlab, right?) deals better with Asian scripts
("CJK") or right-to-left (RTL, like Arabic, Farsi, Hebrew) and
whether it allows images and graphviz stuff?

Ice Polar

unread,
Mar 27, 2009, 5:15:06 PM3/27/09
to trac-...@googlegroups.com
Hi Olemis,

thanx for your reply. I wondered if my request is lost or something like that. Don't rush it is no problem of life.
It would be nice if this PDF-stuff is coming into home straight.
Beside of WikiToPDF-Plugin i also use the PageToPDF-Plugin but with the same troubles. i even don't know if there exists a commn reason.

And what i missed to say the last few mails: trac is a superb application, i love it. You all do a very goog job, thanks.

sincerely
  Ice





2009/3/26 Olemis Lang <ole...@gmail.com>

Álvaro J. Iradier

unread,
Apr 2, 2009, 5:51:00 AM4/2/09
to trac-...@googlegroups.com
I've uploaded my quite improved version of WikiToPdf to trac-hacks:

http://trac-hacks.org/wiki/TracWikiPrintPlugin

WikiPrint features:

* Fully customizable header/footers for PDF
* Syntax highlighting in exported format, using pygments
* Customizable front page for PDF book format
* Automatic creation of Table of Contents if [[PageOutline]] Macro is used

The style of the resulting PDF or HTML can be fully customized using CSS files.

Hope you find it useful.

Greets.

Simon Martin

unread,
Apr 2, 2009, 7:10:01 AM4/2/09
to Trac Users
Hi,

> I've uploaded my quite improved version of WikiToPdf to trac-hacks:
>
> http://trac-hacks.org/wiki/TracWikiPrintPlugin

this seems to be quite cool and useful.

It would be nice, if you would mention more requirements on TH, i.e
reporrtlab, html5lib, PIL, and pisa.

I like it and I will come back with more comments, when I've played
enough :)

Thanks!
Simon


Álvaro J. Iradier

unread,
Apr 2, 2009, 8:51:50 AM4/2/09
to trac-...@googlegroups.com
On Thu, Apr 2, 2009 at 1:10 PM, Simon Martin <simon.j...@gmail.com> wrote:
> It would be nice, if you would mention more requirements on TH, i.e
> reporrtlab, html5lib, PIL, and pisa.

Yes, I was going to do it right now...

Greets.


> I like it and I will come back with more comments, when I've played
> enough :)
>
> Thanks!
> Simon
>
>
>
> >
>



W. Martin Borgert

unread,
Apr 2, 2009, 12:59:38 PM4/2/09
to trac-...@googlegroups.com, Álvaro J. Iradier
Quoting "Álvaro J. Iradier" <alvaro....@polartech.es>:
> I've uploaded my quite improved version of WikiToPdf to trac-hacks:
>
> http://trac-hacks.org/wiki/TracWikiPrintPlugin

I played a little bit with the current version and I'm impressed:
So far it's the best trac2pdf implementation I've seen.
¡Muchisimas gracias!

Simon Martin

unread,
Apr 3, 2009, 2:55:53 AM4/3/09
to Trac Users
Hi,

> I like it and I will come back with more comments, when I've played
> enough :)

The required format of the Image-macro should be mentioned on the TH-
page, not only in a ticket.

Is it possible to suppress the TOC in PDF Article somehow?

Could you provide some example files for CSS?


Thx
Simon

Simon Martin

unread,
Apr 3, 2009, 3:02:22 AM4/3/09
to Trac Users


> The required format of the Image-macro should be mentioned on the TH-
> page, not only in a ticket.
>
> Is it possible to suppress the TOC in PDF Article somehow?
>
> Could you provide some example files for CSS?

Is it possible to link the TOC in the PDFs?

It would be very cool, if the links to the wiki in a combined document
could be replaced by doc-internal links, if this wiki page exists in
the doc. But I think this is not so easy to implement :)

Álvaro J. Iradier

unread,
Apr 3, 2009, 4:20:00 AM4/3/09
to trac-...@googlegroups.com
On Fri, Apr 3, 2009 at 8:55 AM, Simon Martin <simon.j...@gmail.com> wrote:
>
> Hi,
>
>> I like it and I will come back with more comments, when I've played
>> enough :)
>
> The required format of the Image-macro should be mentioned on the TH-
> page, not only in a ticket.

Thanks, I'm adding it.

> Is it possible to suppress the TOC in PDF Article somehow?

TOC in articles are included if you use [[PageOutline]] in the
WikiPage. Right now, the only way to remove it is by removing
[[PageOutline]] tag.

> Could you provide some example files for CSS?

You can see the default CSS and content files if you go to the admin
WikiPrint panel, leave the corresponding field blank (to use default
values), and click the View button on the right. You can then copy it
and create a new CSS or content file.

Note that the extra contents and front page will probably by rendered
by the browser, as they are html. Use "View Source" option of your
browser.

I hope this helps.

> Thx
> Simon

Álvaro J. Iradier

unread,
Apr 3, 2009, 4:25:08 AM4/3/09
to trac-...@googlegroups.com
I don't know if it's easy.

I think the TOC is made by ReportLab, I just insert a <pdf:toc /> html
element before passing the html code to xhtml2pdf library... I'll take
a look.

Greets.
Reply all
Reply to author
Forward
0 new messages