Jump to content


[Snippet] PDF writer


2 replies to this topic

#1 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 17 November 2009 - 04:49 PM

File Name: PDF writer
File Submitter: Cris D.
File Submitted: 18 Nov 2009
File Updated: 29 Nov 2009
File Category: 3rd Party Integration

/************
PDFWriter V1.0
Use: A snippet to export etomite pages as PDF
Cris D 2009-11-17
Etomite 1.1
based on the FreePDF class http://fpdf.com
*****/

Installation instructions:
  • Unzip the contents of this zip archive.
  • Create a folder called "pdf" in the root of your site.
  • Upload the fpdf.php file to this folder.
  • Upload the folders "images" and "font" to this site also.
  • Now you should have:
siteroot > pdf > fpdf.php
siteroot > pdf > images > logo.gif
siteroot > pdf > images> pdficon.jpg
 siteroot > pdf > font > [contents of font folder]

The other files and folders in the fpdf16 are for reference only
and it contains many really good tutorials and samples of how to use it.

  • Copy the contents of the pdfwriter.txt file and save it as a snippet in your etomite snippet library.
  • Call the snippet in a page or in your site template.
There are 2 optional configurations:
  • $image [0] || [1] (Default 1) : A switch to show an icon or a text link to get the PDF.
  • $linkMessage = "Export to PDF";
In addition, there are many ways you can lay out the page - I will not be providing support for this - it's up to you.
There's enouogh help included in the tutorials and samples for you to work this out yourself.

Enjoy.

[updated snippet documentation to clarify the uploaded file structure]

Click here to download this file

Edited by Cris D., 29 November 2009 - 06:59 AM.


#2 Dean

    Loves Etomite Forums!

  • Admin
  • 4,746 posts
  • Gender:Male

Posted 03 June 2010 - 04:36 PM

Hey Cris,
It doesn't parse snippets? it just shows [[snippetname]] or [!snippetname!] ? Have you come across this?
Cheers,
Dean

#3 Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,104 posts
  • Gender:Male

Posted 09 June 2010 - 08:46 AM

View PostDeanC, on 03 June 2010 - 04:36 PM, said:

Hey Cris,
It doesn't parse snippets? it just shows [[snippetname]] or [!snippetname!] ? Have you come across this?
Cheers,
Dean
Yeah, i didn't wory about including this as it was really only a proof of concept. Anyway, I've built a few different external parsers (RSS is probably a good example) that can quite easily plug into this snippet code to parse all snippets prior to rendering the html markup as a PDF.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users