A rough-but-functional rewrite of the Pdfview module for 4.7. Most of the original code has been replaced by ripped stuff from print.module, and the documentation has been updated to reflect the html2fpdf requirement, rather than fpdf.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | fpdf-tcpdf.patch.txt | 9.49 KB | Egon Bianchet |
| #10 | pdfview.module.patch.txt | 9.48 KB | Luca Lenardi |
| #8 | pdfview.module.patch | 9.24 KB | darren oh |
| #7 | pdfview_3.patch | 9.5 KB | urbanfalcon |
| #5 | pdfview_2.patch | 9.81 KB | urbanfalcon |
Comments
Comment #1
sanduhrsTheres a typo on line 60 of pdfview.module.
Changed your patch accordingly.
Would be great if pdfview could support book-type nodes.
It could use the output generated by the "printer-friendly version " version.
vg
Comment #2
tfejos commentedCouldnt' apply the patch.
$ cat pdfview_02.patch |patch
patching file CHANGELOG
patching file INSTALL
patching file README.txt
patching file pdfview.module
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 333:
Can anyone send me a patched Pdfview for 4.7?
Comment #3
inteja commentedSame here. Malformed patch. Tried everything I could. Can some please redo the patch or post the already patched module?
Comment #4
inteja commentedScrap that. pdfview_02.patch didn't work for me but pdfview_1.patch did.
Comment #5
urbanfalcon commentedUpdated against CVS. Works in 4.7 and, with this patch, can recursively print out not just book nodes but entire books (each node being on a separate page within the same pdf). Patch also introduces ability to show/hide link per node type in addition to access control via permissions. Tested and everything works on my end, but doesn't hurt to get a second opinion.
Comment #6
Tobias Maier commentedplease follow the coding standards
http://drupal.org/node/318
especially this: http://drupal.org/node/539
your patch is hard to read because you replaced every double-space with tabs
remove the
?>at the end of the fileComment #7
urbanfalcon commentedFor the benefit of the community, I did a quick search + replace for tabs. Hopefully the patch still works...theoretically, it shouldn't have corrupted anything. Tabs vs. spaces is an endless debate, but tabs require less space in a file than multiple spaces (and thus obviously get my vote). To make everyone happy, I'll keep my copy (and my installation) streamlined with tabs...and hopefully search + replace will work for stuff like this.
Comment #8
darren ohpdfview_3.patch did not work. I patched with pdfview_2.patch and generated a new diff according to the instructions in the handbook. I hope it's acceptable.
Comment #9
pancapangrawit commentedCool, pdfview.module.patch works for me in 4.7 with php5.
May I ask: is there a way to configure the codepage or characterset? We use german texts and have a lot of Umlauts. They show up as:
TestArtikel für IME-Intern (rather than 'für')
Thanks for any help
Best
Rainer Schuetz
Comment #10
Luca Lenardi commentedThis patch fixes some small bugs (for l12n and other small things) and also implements the support for phptemplate.
The 'pdfview_generate_page' is now a theme function so that users can modify it in template.php.
Comment #11
pancapangrawit commentedWas that latest patch supposed to do something about the "Umlauts" (üä etc)? If yes, it seems not to have done the job :-(. Could somebody give me a hint what to do in order to make german special characters (äöüÄÖÜß) work? In the html2pdf subdirectory I see all sorts of characterset-related files but I couldn't find any info how to solve my problem.
Thanks in advance for any help
Rainer
Comment #12
killes@www.drop.org commentedRainer, this is sort of non-fixable unless you convert Drupal's output to latin1 before (which might break other stuff). PDF and utf-8 don't go together well.
Comment #13
pancapangrawit commentedthanks, killes
Comment #14
urbanfalcon commentedTwo things I have found with this module:
1.) The pdfview output wasn't taking into account any filters. If you format all your pages to "talk like a pirate" you want to see pirate speak in your pdf, not a completely different body.
2.) There's no protection for pages containing PHP code. If you have a book page filtered to allow code and you save it out so that it runs and does whatever to display dynamic content...your user might think they can get that dynamic content output to PDF. However, what they get is a printout of your entire node body in pre-rendered PHP code. They can see every echo, and every password you may have been unlucky enough to use for external database connections. This is a serious security issue.
My fix for both was to turn this:
into:
I'd like to see that the PHP code is actually rendered out the way the user experiences it on the actual page, but I haven't found a way to do that. The eval function is not reliable as there's no way to know the depth of the PHP code within the body.
Comment #15
Egon Bianchet commentedThis one works with TCPDF, which supports UTF8 and many other things.
You have to download the PHP4 version, extract it in to the modules folder, and set the "K_PATH_MAIN" variable into tcpdf_php4/config/tcpdf_config.php
Comment #16
Egon Bianchet commentedI meant "into the module folder"
Comment #17
Egon Bianchet commentedD'oh
Comment #18
killes@www.drop.org commentedEgon, would you like to become the maintainer of this module? I wrote is quite some time ago but handed it to the librarian who seems to be not too interested anymore.
Comment #19
Egon Bianchet commentedYes, I'd be happy to do it :-)
Comment #20
killes@www.drop.org commentedOk, I've assigned the project node to you. IF you don't already have cvs access you will need to apply at http://drupal.org/cvs-account
Comment #21
Egon Bianchet commentedI sent an application months ago but I think it's still pending ...
Comment #22
killes@www.drop.org commentedI have fixed this.
Comment #23
Egon Bianchet commentedCommitted to HEAD
Comment #24
pancapangrawit commentedCoool!
Thanks a lot Egon and others.
Rainer
Comment #25
darren ohPdfview does not yet appear in the list of 4.7 modules.
Comment #26
darren ohComment #27
Egon Bianchet commentedComment #28
darren oh