Skip to content
bizonbytes edited this page Mar 21, 2012 · 3 revisions

PdfMaker Built for cfwheels

With pdfMaker you can create a pdf file to be sent to the browser or saved to your folder of choice.

The features are:

  • Create the document from a partial, a URL or a simple string.
  • Once the pdf created save your file or just send it to the browser.
  • Use the plugin as a pdf Friendly by selecting the type url and then it will grab the actual page or your page of choice.

How to us it?

  1. Select your document content type by choosing between partial | url | text for the arguments "type" then Inside your controller lets say you want to print to your pdf a partial then call it like this:

<cfset createPDF(type="partial", partial="/shared/pdfinvoice", sendToFile="true", filename="yannick")>

If you want to use it as a pdf Friendly (create a pdf of the actual page) and send it directly to the browser.

<cfset createPDF(type="url")>

Or you want to create pdf of a string you could do this.

<cfsavecontent variable="string" > cfwheels rocks<br> <strong>+1</strong></cfsavecontent>

<cfset createPDF(type="text", text="#string#")>

Parameters

doctype | type=string | default=partial | required=false | hint=choose the type of content to print to the pdf. You can choose between : partial | url | text.


partial | type=any | required=false | hint=The name of the partial file to be used for the content. ONLY if you have selected type(partial)


url | type=string | required=false | default=current url | hint=The url to grab for the document content. Default is the current page. ONLY if you have selected type(url)


text | type=string | required=false | hint=The text to grab for the document content. ONLY if you have selected type(text).


sendToFile | type=string | required=false | default=browser | hint= Save to file. Otherwise send to browser


pathTofilename | type=string | required=false | hint= Path to the filename. By default its /files. ONLY if you have selected sendToFile(true)


filename | type=string | required=false | default=browser | hint= Name of a file to contain the PDF. ONLY if you have selected sendToFile(true)


overwrite | type=boolean | required=false | default=false | hint= Specifies whether we should overwrites an existing file. Used in conjunction with the filename attribute. ONLY if you have selected sendToFile(true)


orientation | type=string | required=false | default=portrait| hint= Page orientation: portrait | landscape


footer | type=string | required=false | default=| hint= Text to add to the footer


header | type=string | required=false | default=| hint= Text to add to the header

Clone this wiki locally