We have work to do.
First of all, currently new features are not the first goal, more it is a user friendly installation, configuration and use
- header/footer should be read out of a TWiki topic ( like a template ). We need to define some usefull variables like web/topic/user/version etc.
- pagewidth, media,cssmedia,landscape and margins should be configured though TWiki
- we could pass them through the console script, which would result in a huge command line ( which is limitted in lenght ). This would be optimal, as we could pass thins like media / landscape individual for a topic
- we could parse the LocalSite.cfg like we do with the path( so set them through configure ). Not practical for all parameters
- Any ideas?
--
MayerEugen - 01 Jun 2008
Thank you Mayer for sharing this add-on with the
TWikiCommunity! As you stated, at some point it makes sense to merge this into the existing
GenPDFAddOn.
Some feedback/questions:
- Avoid extra question mark links (I escaped them in the add-on topic).
- Escape top heading so that it does not show up in the TOC.
- Use interwiki link to point to other extensions, unless there is a dependency (this is to avoid broken links when this add-on is installed).
- I moved the " We have work to do" to this dev topic.
- This add-on requires PHP. Not sure if there are any security implications (wiki + open php engine), worth checking.
- On pagewidth etc, you could use preferences settings. They can be defined site-wide in Main.TWikiPreferences and overloaded by user, on web-level and page level.
--
PeterThoeny - 02 Jun 2008
I tagged the add-on topic, help with tag vote if inclined.
--
PeterThoeny - 04 Jun 2008
I dont think PHP is a security threat in this case. PHP is only used in command line mode, so no way to access PHP through the browser ( or better, no need to let it be accessable for
ToPDFAddOn). In addition, yet not parameter are passed directly to the script YET!
This could change with the variables like pagewidth and stuff, which cann be defined on user base even, so this could be a thread i there are "Command line injections" used. We need to check any content passed to the command line for any harmfould things. We could simply pass it with quotes and escape any other content. Esp. dangarous are things like | or &.
--
MayerEugen - 05 Jun 2008
It isn't clear to me from the documentation, but what is the difference between this and GenPDFAddOn? Is it that ToPDFAddOn supports TWiki's CSS and the other doesn't.
I'm asking because I'm having issues with GenPDFAddOn and I'm wondering if this is a potential replacement. But the documentation seems to be written in the future tense, which isn't very encouraging. Plus, I'm on Windows and it isn't tested on that yet. So I'm not sure if it's even worth testing at this point.
--
SeanCMorgan - 05 Jun 2008
the main functional difference is the html to pdf engine they use as a backend.
GenPDF uses HTMLDOC a fast C based converter that does not yet have very strong css support (though the development versions are getting better) while
ToPDF uses
Html2Pdf, which is more complete, and (i find) much much slower.
Have you reported Bugs for the issues you have with
GenPDF? I've made a few fixes this week, that I've not yet commited, but are mentioned in the Bugs system.
--
SvenDowideit - 06 Jun 2008
I can't get it to work..
- If nobody is logged in I get
- If I log in, I get
- after changing ToPDF.pm:212 from $session->{user}->wikiName() to $session->{user}; i get
--
EnricoRos - 07 Jun 2008
EnricoRos, are you using TWiki 4.2? The following worked for me:
my $userName = TWiki::Func::getWikiName();
(I attached a patch which only uses this form for
TWiki::Plugins::VERSION ≥ 1.2)
--
MarkusUeberall - 08 Jun 2008
There are bugs with fetching Images, so in the current version the images are not inlcuded in the PDF, only a placeholder. I fixed this bug and will commit this in a few.
The performace issue is known, but i guess its nothing suprising that supporting such a wide variarity of CSS like html2pdf does, is resulting in a much complex parsing and therefor slower processing. Yet, it did not harm me, it was fast enaugh for any needs. I will probably optimze the code of html2pdf, as its massive OOP and maybe there are some ways to optimize it ( Especilly PHP5 wise ). In addition, its possible to precompile the whole html2pdf thing and use it then, this could really help a lot in performance related things.
Disscussing with
SvenDowait it could be reasonable to support both backends, htmldoc and html2pdf for easy switching and choose.
--
MayerEugen - 08 Jun 2008
(Re:
SvenDowideit - 06 Jun 2008)
I summarized my issues in
TWikibug:Item4437
on 14 May 2008. More details are at
TWiki:Support/GenPDFAddOnImageErrors
.
--
SeanCMorgan - 09 Jun 2008
ok the code is in under svn now, trunk/ToPDFAddOn
The svn version supports images and fixes all bugs i managed to fix yet.
--
MayerEugen - 09 Jun 2008
Licence issues: As just dicussed on the IRC channel, we need to get rid of the included original TrueType fonts, because they may not be redistributed (any more)--
both in the downloadable bundles and in the repository. Refer to
http://corefonts.sourceforge.net/
for details on how to obtain and use (older) copies on non-Windows systems.
Update: I replaced the archives.
--
MarkusUeberall - 14 Jun 2008 / 10 Jul 2008
>
it could be reasonable to support both backends, htmldoc and html2pdf for easy switching and choose
That might avoid some duplication of effort.
BTW, it looks like the intent of HTMLDOC 1.9 is to add CSS support too. It seems to be taking it forever to be released though.
--
SeanCMorgan - 20 Jun 2008