Skip to main content
September 8, 2006
Question

Generating PDFs With Coldfusion

  • September 8, 2006
  • 2 replies
  • 386 views
I have a few questions regarding the generation of PDF's with ColdFusion MX7.

For some reason when I generate a PDF from a URL the PDF generated looks awful. e.g. the layout is everywhere, some items don't even appear and is far from 'Printer Friendly'.

This isn't an issue with my code but I believe it may have something to do with the websites themselves. I know CFDOCUMENT has some support limitations...does it support xhtml transitional with external stylesheets? The reason I ask this is because the only sites that seem to render ok (and I say just 'ok') are sites with generally bad markup where css is embedded within the structure itself...e.g. font tags and table layouts.

My second question is regarding the capabilities of cfdocument. Believe it or not I have found it quite difficult to track any information on its capabilities. Is it possible to generate PDFs from documents that can be uploaded. e.g. a MS Word doc?

This isn't a rant or anything, I'm just really confused! Ha.

Thanks for any help in advance.

Regards.
    This topic has been closed for replies.

    2 replies

    Bouton.Jones
    Participant
    October 30, 2017

    Hopefully better late (11 years) than never.

    CFdocument will not generate a tagged PDF.  Adobe doesn't plan on fixing that.

    CFHTMLtoPDF was introduced in ColdFusion 11.  It generates a tagged PDF --- except the image descriptions (ALT attribute values) are not being exported to the PDF.  As of this reply the Adobe intends to fix that in the next release.

    I suggest using CFHTMLtoPDF but avoid using images.  If images must be included, you might caption the images with plain text (in the manner of newspapers or news magazine) and use the aria-describedby and id attrbutes to anchor the captions to the images.

    Note that you must start with an accessible HTML document with strict (semantic) HTML and perhaps some WAI-ARIA.

    I hope this suggestion helps someone.

    September 9, 2006
    Can anybody advise with this?