PDF use cases

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Egon Bianchet's picture

What do you need from a Drupal PDF module? Do you need it to format a web page just to send it to the printer, or do you need it to generate a document like an invoice, a book, or catalogue?

How much theming and customization flexibility do you need?

Comments

Use case - connecting the community plumbing to offline actors

ndru's picture

This has the potential to be a great feature set. In many community organizations, for whatever reason, there's a large set of people who need to be included in the community who are not able to participate on-line. Paper is a great technology for including these users. To allow them to experience the "life" of the site, and the life of the community that the site represents, I think that some way to select a pile of nodes (like through a view, or a taxonomy query, or through a module like simpleNews) is needed. So the sequence would look something like:

  1. Select a pile of nodes somehow (see above)
  2. Choose some level of detail in which to represent the nodes (either titles, teasers, full)
  3. Apply some default theming or styling functions, allowing others to plug in their own fairly easily (realizing that needs will vary considerably about this)
  4. Generate a PDF based on the styled node collection
  5. Either display the PDF, or plop it in some directory, or attach it to a node and tag it with a particular taxonomy term.

I'm thinking of the case where an organization might want to periodically generate a newsletter / update for its offline members. Potentially it could generate several newsletters, or even generate individually customized newsletters, which a staff person could print and mail (or hand out) to the offline members.

Hope this helps you see some of the potential for this kind of module.

I'm actually interested in the reverse functionality

ulfstein's picture

ie. viewing PDF documents within Drupal. The site I am working on requires uploads of large amounts of PDF documents and we'd love to be able to view them within the browser rather than launching an external viewer - pretty much what these guys are doing but within a Drupal environment: http://view.samurajdata.se/

This looks amazing and would

s.Daniel's picture

This looks amazing and would be an awsome feature.

Maybe Adobe could be asked to support such a projects as this is the best marketing one could ask for. Make others not only use your product but multiply the usage.

I've done something similar.

Saubhagya's picture

I've done something similar. Module is under review and i want you people to give some feedback.

In drupal way it is always a joint effort. So take a look at http://drupal.org/node/748442

I want to generate a list of

Tobias Maier's picture

I want to generate a list of events listed in a table.
This table should be downloadable as PDF File.
So that every member has an offline version and also members without internet could get a great looking one for their use.
I need the same functionality for a telephone list, too

What I personally don't need is a way to download a single node.

About theming:

  1. I think it is necessary to be able to theme everything. Beginning with the header and ending with the footer :)
  2. PDF output of views should be themeable individually - I should be able to create a special theme for every view or maybe even for every content type.
    One Idea could be to extend the tcpdf class and add a new method: SetThemeFunctions() which accepts an array of different theme functions for footer, body, head and a general one. If one of this function was not specified it should use the default one.

What I like is, that tcpdf has a html interpreter, but which does not work perfectly.
What I really dislike with tcpdf is that it has no proper error handling every single and stupid error ends with a die()
I created for the a feature request at sourceforge: http://sourceforge.net/tracker/index.php?func=detail&aid=1652731&group_i...

Tobias Maier - http://www.tobiasmaier.info/
--
Switch to Firefox!
Steig auf den Firefox um!
mozilla.com

Tobias Maier - http://tobiasmaier.info/

Problems with Drupal5

Ermoe's picture

After installing pdfview and following the (rather not very complete manual) I do only get " | Array " instead of a view as pdf link.

Drupal 5.1
PHP5
Apache

Is there a bugfix for that?

Thanks in advance,
Hermann

Hello Hermann, please use

Tobias Maier's picture

Hello Hermann,

please use the Drupal Issue Tracker for a support request or to submit a bug.

We are talking about use cases on this place.
Please provide your use case here.

Thanks

Tobias Maier - http://www.tobiasmaier.info/
--
Switch to Firefox!
Steig auf den Firefox um!
mozilla.com

Tobias Maier - http://tobiasmaier.info/

Whole threads

wouter's picture

Hi,

We're using the pdfview module on KnoSoS (http://www.knosos.be), an experimental knowledge sharing platform.

Case : Events are often used to schedule (online) meetings. Using the comments is an ideal way to collaboratively add agenda points and also to discuss the results of the meeting afterwards. Hence those comments are very useful information.

I would very much like to see a way to (optionally) include comments to the pdf-view of a node.

I might have overlooked this feature perhaps, so my apologies if my case here is useless.

If not, then what are your views for a possible implementation of this ? perhaps we could do some of the work, if you haven't got it on some to-do list already.

Best regards,
Wouter

ica's picture

'Publication' or 'Journal' output of the PDF module, that would be a good facilation of such module and add Drupal yet one more advantage over other CFS's..

There is an open source project from Canada Open Journal Systems (OJS) does exactly that -only that
http://pkp.sfu.ca/?q=ojs
example site
http://ijoc.org/ojs/index.php/ijoc

i think similar 'publication or journal' content type can be achieved with conjunction of the book module and the taxonomy -as volumes- and with an calendar view output of mothly or weekly or other publication durations..
the challange is the PDF output in a single document in multiple pages.. a publication structured document in volumes -that is a single PDF file in this case..

just a PDF module usage thought. (I am not a coder to make coding contribution unfortunalely)

Role-playing Game Character Sheets

CleanCutRogue's picture

I plan on using Drupal for an online role-playing game collaboration site. I'd like to have users to be able to enter data on a page, selecting things from combo boxes and typing up stuff in textboxes, have that data stored, and allow the user to click a button to get a 1 or 2 page PDF of his character sheet with all relevant fields on it populated.

intranet use case

WorldFallz's picture

I use drupal for a corporate intranet site storing all types of corporate data including: policies, procedures, processes, memos, documents of all types. We use the PDFView module to output pdfs of nodes when we need to send it to someone who, for whatever reason, doesn't have access to the main site. Because we are an outsourced IT support organization we frequently have to post our process/policy/procedure docs to the mother company site b/c the intranets have no connection to each other.

For the most part the module meets our needs as is, but ideally should be more customizable through the user interface. Currently, as admin, I have to do all the customizations in the theme by overriding the function.

Features we'd like to see for our use case are:
1. custom output per content type
2. UI settings for header, footer, margins, logo, & cover page (per content type)
3. the ability to designate a role that could change #2 but not #1. Ideally this would extend to the OG group manager level so that group managers could change their format for their content only.

Until I got this module working, I was using "Print Friendly Pages" and instructing users to output to the freeware CutePDF (with gsview) pdf printer utility and was researching customizing that module to offer the option of sending that output to tcpdf.

It seems to me that there is a great deal of commonality in uses between the two modules-- it might make sense to combine resources and develop jointly.

I'm still learning to program drupal, but am eager to volunteer my services on this project.

We need an ability to

ardas's picture

We need an ability to generate invoices most of all. To make it effectively we need a flexible support of table element as well as automatic multi line texts (this is when you pass a long description and it should be aligned in a table cell and splitted into several lines).

Regards,
Dmitry Kresin, ARDAS group - Drupal CMS web sites development, Software outsourcing


Regards,
Dmitry Kresin, ARDAS group - Drupal CMS web sites development, Software outsourcing

I second this motion.

jo1ene's picture

I would also like to email a node (invoice) as a PDF - to a specified email address, at least. I am considering using OG to set up client home pages, so sending a node as PDF to all OG group members would be cool.

This would presuppose reliable handling of all CCK fields.

This even has a greater application as I would think that emialing a read only version of a node would be useful in other respects.

print a book

lejon's picture

I would like to be able to print a book along the lines of the facility in PMwiki:

http://www.wikipublisher.org/wiki/

This would mean that people would be able to print off the very latest version of an online manual at any time.

wow--- wikipublisher is very

WorldFallz's picture

wow--- wikipublisher is very cool. I'd not seen that one before. And yes, having that functionality would be awesome. I'll have to keep that solution in mind for sites that require nicely formatted output.

yup, maybe it could be adapted?

lejon's picture

At the moment it's only used for PMwiki. Maybe it could be adapted?

I'm in no way shape or form

WorldFallz's picture

I'm in no way shape or form a "coder" ( i know just enough to hack myself into trouble, lol) but I plan to take a look at the code when I get a chance to see how big a deal it would be.

Wikipublisher

SamRose's picture

Hell yeah!

This is exactly the reason why I am lurking here. This is a "missing link" in Drupal for publishing.

Although, I can tell you that implementations of web-to-pdf-to-book are usually quite problematic, and not that "clean" if you actually want to create a printed book.

But, looks like WikiPublisher is headed in the right direction. http://www.wikipublisher.org/wiki/index.php?n=Wikipublisher.InstallTheSe... uses LaTeX

I think that Drupal could instead base off of http://wiki.contextgarden.net/What_is_ConTeXt which integrates vector graphics, instead of the image magick bitmap that Wiki publsiher uses.

This argument about integrating http://wiki.contextgarden.net/What_is_ConTeXt into drupal goes beyond our discussion of PDF integration.

But, basically, I have to come out and say that it would be awesome to emulate and improve upon what you see at wiki publisher, but using http://wiki.contextgarden.net/What_is_ConTeXt as part of th engine, so that you could take collections of practically any type of node and combine them together into a "book" that is typeset and ready to print as PDF, which could then be used by a print on demand printer to output actual books (part or all of a book). Would be cool to be able to buy just the parts of large books that are needed, for instance. (we discuss this at http://socialsynergyweb.net/cgi-bin/wiki/MicroBook)

Sam Rose
Social Synergy
Blog

Use Cases

johnbarclay's picture

I need to be able to:

  1. select which parts of node to convert to pdf (don't show nav, logon etc.)
  2. use existing node security for viewing the pdf
  3. be able to control the mapping of html elements and classes to particular pdf rendering (Paragraph text is block, 10 pica height; H3 is inline, italic)

I had to do something similar for some custom built form generation software that needed view only pdf versions of forms and used the following approach:

  1. Start with xhtml for web browser + xml document articulating exceptions for the particular document
  2. transform with xslt to xsl-fo
  3. apply apache fop to get to PDF (or jfor for rtf)

Ignoring the tools used which are probably not appropriate for a Drupal module,
the problem with html to pdf is that the developer will want to determine exactly how each html element maps to pdf rendering. This can end up involving a whole new intermediary language. I started off with Doug Tidwell's XSLT at http://www.ibm.com/developerworks/library/x-xslfo2app/ for the trasformation and allowed for a per document type override of all html elements to xsl-fo mappings.

Its vaguely outlined at:

http://www.johnbarclay.com/programming/plus_flowchart.pdf and

http://www.johnbarclay.com/programming/plus_documentation.pdf

But who wants to develop an intermediary language for mapping html to xsl-fo or whatever document preceeds the pdf document in the transformation process.

When print css came along I ended up repeating the info in print css as in the configuration xml files. ( though I could have generated the print css from the config xml I suppose.)

An solution could use print css as the xhtml to pdf configuration language. The print css file could be the same print css page used by the browser in printing or a second print css file used only to convert to pdf. Aside from print css being something people are used to working with the display:none rule could be used to hide unwanted parts of a page from pdfs and fullfilling my 1 and 3 use cases.

I'd be willing to help on this module. I've been working with Drupal for 6 months or so and php for a couple of years.

I have different needs

Patola's picture

Ok, I may be talking lots of stupid things here, but the main point I wish to raise is that Drupal is not about PDF, it is about HTML. It was made for the web, it will render HTML. PDF is an afterthought. As such, albeit XSLT and LaTeX are obviously superior approaches, they would be just excess layers for building the final output. If one can't stand to lose formatting,

So, I think the best approach would be to generate a really good HTML output that could be nicely converted to PDF. With line breaks, Table of Contents (generated from the book structure), Page Numbering (is it possible in HTML?) and everything else. Also, it would use drupal filters, so a LaTeX formula could appear as a PNG and be smoothly converted to a PDF picture. Then, an external program (or maybe a library) would just get this HTML-with-pictures and generate a PDF file.

My main need for this is with books. So, there's little need of individually selecting pages, it would follow the book's structure. The options would be something like that:

  • ( ) Print bibliographic reference (using biblio)
    • [ ] At the end of each chapter
    • [ ] At the end of the book
  • Page size
    • [ ] Letter
    • [ ] A4
    • [ ] A5
  • ( ) Print comments
    • [ ] As an appendix at the end of the book.
    • [ ] On each node.
    • [ ] At the end of each chapter.
  • ( ) Extract links
    • ( ) Keep links clickable
    • ( ) Generate links reference at the end of a
      • [ ] Node
      • [ ] Chapter
      • [ ] Book
  • ( ) Add line feed at the end of each page
  • ( ) Print page numbers (maybe that would only be possible with the previous option set. How could I number pages in HTML? Would I have to resort to tricks like adding a line before the page break or adding spaces?)

Well, whoa, that is what I need. If I have enough time, I'll try to program it myself. I am still rehearsing and I am trying to choose amongst htmp2pdf, htmldoc or dompdf to generate the final PDF. I'd probably have to use temporary files for this, though, because of the images/filters. I don't know if I can generate it inline.

With this kind of HTML output that can be nicely converted to PDF, one could always keep using XSLT or LaTeX to reprocess it and adapt to his/her neeeds. So it would be a good solution, in my opinion. What do you think?

This is pretty much what I

WorldFallz's picture

This is pretty much what I need also. I'm sort of cheating by using the Printer-Friendly pages module to control the HTML via print css specification then "printing" to a PDF print driver.

Seems to me there's actually a lot of overlap between the approach you outline and the Printer-Friendly pages module-- the only difference being where the output is directed (physical printer vs. PDF creation utility). Regardless of output device, the main idea in both cases is to add some controls for specifying the HTML created for certain output devices.

A spectrum of needs

SamRose's picture

It seems to me, based on feedback here and my own experience, that there is a spectrum of needs.

And, as such, it would be probably best to have a basic "glue" module for output of Drupal content to PDF, that would allow other processing to attach to it.

This basic module would basically accomplish part of what Patola outlines above: basically, to "generate a really good HTML output that could be nicely converted to PDF."

This basic module could allow multiple, or any choice of open source PDF processing library, including TCPDF, htmp2pdf, htmldoc or dompdf, or anything else. Thus, site admins will not be restricted to one HTML to PDF processing solution.

Then, there could also be modules that connect different processing abilities, such as Print CSS, XSLT, LaTeX, ConTexT, etc. And modules could be developed and deployed that would allow for complex, paginated PDF creation based on multiple Nodes of different types. This way, a PDF could be genereted from "book" content, but also from any other content.

Sam Rose
Social Synergy
Blog

Glue and Forms

light-blue-pdx's picture

My PDF requirement is to convert a collection of in-house paper forms into a digital format, so that once filled out over HTML, a final PDF version becomes available (not unlike the on-line IRS tax forms approach).

In that usage case, it seems to me that Sam's "glue" might be something like http://www.ros.co.nz/pdf/ -- though honestly, it might not handle the positioning of HTML elements (the print page to PDF approach) in the way this group requires, or at least, not without tweaking.

Given my forms requirement, I'm curious about your thoughts on the following approach: write a module to hook into certain content types and provide additional fields requesting X and Y coordinates for that content type's form elements on the final PDF document. Such a module would ideally be CCK-field aware. This user-collected positioning data would then fed to the "glue" above.

Thoughts?

CSS support

seutje's picture

my kingdom for CSS support in the PDFView module :(

and a more flexible theming way would also be much appreciated, since I can't seem to have this thing spit it out the way I want it

but I suppose it's better than nothing, considering I'm forced to use drupal5 and the printer friendly module doesn't support D5 :x

<3

In case anyone has gotten

1kenthomas's picture

In case anyone has gotten here and not see, PDFView now informs users it is unsupported and directs people to http://drupal.org/project/print, Printer Friendly Pages.

Nothing seems to support Views.

~kwt

Current Status

mikehas's picture

This has been a relatively helpful thread. I did see that Printer Friendly Pages is still recommended as of February 2010. Has anyone had success doing true digital publishing to print and web using drupal (e.g. large books, magazines, catalogs for web and print with a team of contributors and editors).

My specific need is for publishing an academic course catalog to the web and pdf. This means the ability to export a large set of pages (100s) to a single pdf document for the publishing company. Has anyone seen recent developments in pdf support in drupal?

PDF Use Case

kmadel's picture

I have actually implemented a very rough action module that exec's a call to the Java based fop (Apache FOP) to take a node that is converted to xml and an xsl stylesheet that I authored to generate FO XML that is then converted to a PDF by Apache FOP. Now, please note that this isn't a process that could handle a large load and the intent for this use case is to create PDF versions of certain content types when they are saved, not on demand PDF generation of the current page. However, XSL-FO supported by Apache FOP gives you a large degree of control over the layout and look of the PDF output.

Possibility of Catalog-on-Demand for Drupal

Catalog-on-Demand's picture

First of all, I realize that this thread is about use cases, not solutions, so perhaps I'm doing something wrong with this post. If so, please let me know ASAP. Hopefully you can give me a better idea where I should post this.

We have a subscription-based web service that allows non-technical business people to produce professional-quality PDF catalogs from their e-commerce site. This service, called Catalog-on-Demand, has a starting subscription fee of around $10 per month.

We have been in business for more than 15 years. Until recently, almost all of our customers were large companies. Now we are focused on bringing our technology to small- and medium-sized businesses who already have e-commerce sites. The benefit to these businesses is that custom catalogs help them continue to sell AFTER the visitor has left the e-commerce site.

While we are experts in the field of automated publishing, we are not e-commerce or Drupal experts. Therefore, we would like to partner with a developer who is familiar with Drupal extensions. Our preference would be to enter into a revenue-sharing arrangement with such a developer. The first version, for purposes of testing the waters, should take less than 10 hours of development. It involves transforming the product information into a text string using our datafile format, and then packaging that string in an api call. You don't need to know anything about publishing. That is handled on our end. And yes, we do a decent job of handling embedded html.

If you are a developer interested in partnering with us, please contact me via this forum or
this contact form. I'll be glad to provide samples and more details.

BTW, this concept applies to any kind of content, not just products. We've been focused on product catalogs because that is where there is the greatest need. It is clear from this thread that there are many Drupal sites that would like to produce high-quality PDF renderings of user-selected content.

Tim Hennings
Catalog-on-Demand

PDF as a drupal node and/or book pages?

CaptCrunch's picture

I want to be able to upload PDF documents and have drupal nodes index them directly, e.g. as book pages. It should load within the content area or targeted block just like any other node. You could certainly do this sort of thing using frames (yuk), but drupal seems to eschew frames. If drupal nodes supported , drupal could open a new window with a reference to the PDF file in htdocs, though that content would not be managed by drupal.

- Mike
Computational Intelligence

This looks amazing and would

nguoivietminh's picture

This looks amazing and would be an awsome feature.

I think I find out something now, thanks Patola.

IQ test teste de qi test de inteligencia quotes about life

Is something like this possible?

j4's picture

Attaching an image from the site www.rpbw.com, where they allow us to select projects to be downloaded as pdfs and mail them to an email id of our choice in a very neat manner..

Thanks
Jaya

P.S Just realized that I cant attach anything! So can you please visit the site and checkout any project?

Thanks

One more use..

Seph's picture

I woud love to have users be able to fill in an online pdf form that's on the website, such as a full job application, sign it digitally and then be able to submit it. Then I could access it through the folder it was submitted to and print out a hard copy.

PDF

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: