ColdFusion 8 and PDF Integration - PowerPoint PPT Presentation

About This Presentation
Title:

ColdFusion 8 and PDF Integration

Description:

Coding since 85, CGI Programming since '94 ... Interested in ColdFusion, Flex, Ajax, Frameworks, i18N, L10N, g13N. Have big interest in epistemology ' ... – PowerPoint PPT presentation

Number of Views:80
Avg rating:3.0/5.0
Slides: 18
Provided by: cfu2
Category:

less

Transcript and Presenter's Notes

Title: ColdFusion 8 and PDF Integration


1
ColdFusion 8 and PDF Integration
  • Oguz Demirkapi
  • Sr. Developer TeraTech
  • http//www.teratech.com

2
About Me
  • Sr. Application Developer at TeraTech
  • Coding since 85, CGI Programming since 94
  • ColdFusion Developer since 97
  • Founder and Manager (prev.) of CFUG for Turkey
  • Interested in ColdFusion, Flex, Ajax, Frameworks,
    i18N, L10N, g13N
  • Have big interest in epistemology

3
Why PDF?
  • Invented by Adobe Systems and perfected over 15
    years, Adobe Portable Document Format (PDF) lets
    you capture and view robust informationfrom any
    application, on any computer systemand share it
    with anyone around the world. Individuals,
    businesses, and government agencies everywhere
    trust and rely on Adobe PDF to communicate their
    ideas and vision."
  • http//www.adobe.com/products/acrobat/adobepdf.htm
    l

4
Creating PDF
  • CFDocument
  • ltcfdocument format"PDF" overwrite"yes"gt
  • This is my first PDF document.
  • lt/cfdocumentgt
  • CFReport
  • ltcfreport template"myReport.cfr" format"PDF"gt

5
Working with PDF
  • Tags
  • cfdocument, cfdocumentsection, cfdocumentitem
  • cfpdf, cfpdfform, cfpdfformparam, cfpdfsubform
  • cfprint
  • Functions
  • IsPDFFile
  • IsPDFObject
  • IsDDX

6
Working with PDF
  • ltcfdocument format"PDF" overwrite"yes
    filename"GetDirectoryFromPath(GetTemplatePath())
    /02_cfdocument.pdf" gt
  • ltcfdocumentsection name"First Section"gt
  • ltcfdocumentitem type"headergtlth1gtTeraTech
    Traininglt/h1gtlt/cfdocumentitemgt
  • ltcfdocumentitem type"footergt
  • ltcfoutputgt
  • Total Pages cfdocument.currentpagenu
    mber / cfdocument.totalpagecount ltbr /gt
  • Section Pages cfdocument.currentsect
    ionpagenumber / cfdocument.totalsectionpagecount
  • lt/cfoutputgt
  • lt/cfdocumentitemgt
  • ltcfloop index"loopid" from"1"
    to"10gtltcfinclude template"tempcontent.cfmgtlt/cf
    loopgt
  • lt/cfdocumentsectiongt
  • ltcfdocumentsection name"Second Section"gt
  • ltcfinclude template"tempcontent.cfm"gt
  • lt/cfdocumentsectiongt
  • lt/cfdocumentgt

7
Working with PDF
  • Possibilities
  • Getting info about PDF file
  • Merging PDF files
  • Deleting pages from PDF files
  • Adding/removing Watermark
  • Security Settings
  • Thumbnail Generation from PDF files
  • Server Side Printing

8
Working with PDF
  • Getting File Info
  • ltcfset myPDFDocument "test.pdf"gt
  • ltcfpdf action"getinfo" source"myPDFDocument"
    name"myResult"gt
  • ltcfdump var"myResult" label"PDF Info"gt

9
Working with PDF
  • Merging PDF Files
  • ltcfpdf
  • action"merge"
  • directory"ExpandPath('.')/myPDFFiles"
  • destination"myFilesFromDirectory.pdf
  • overwrite"yes"gt
  • ltcfpdf
  • action"merge"
  • source"ExpandPath('.')/myPDFFiles/test.pdf,
    ExpandPath('.')/myPDFFiles/test2.pdf"
  • destination"myMergedPDFFiles.pdf"
  • overwrite"yes"gt

10
Working with PDF
  • Delete Page From PDF Files
  • ltcfpdf action"deletepages" source"test.pdf"
    pages"1-3" overwrite"true"gt

11
Working with PDF
  • Add/Remove Watermark
  • ltcfpdf
  • action"addWatermark"
  • copyFrom"TTTraining.pdf" source"test.pdf"
  • rotation"15 position"100,0"
    foreground"true" overwrite"yes"
  • destination"myPDFWatermark.pdf"gt
  • ltcfpdf
  • action"removewatermark"
  • source"myPDFWatermark.pdf"
  • destination"myPDFNoWatermark.pdf"
  • overwrite"yes"gt

12
Working with PDF
  • Security Settings
  • ltcfpdf
  • action"protect"
  • source"test.pdf"
  • newUserPassword "mypass"
  • destination"mySecuredPDF.pdf"
  • overwrite"true" gt
  • ltcfpdf
  • action"protect"
  • source"test.pdf"
  • newOwnerPassword"mypass"
  • destination"mySecuredPDF2.pdf"
  • overwrite"true"
  • permissions"AllowAssembly, AllowFillIn,
    AllowModifyAnnotations, AllowModifyContents,
    AllowScreenReaders, AllowSecure"gt

13
Working with PDF
  • Creating Page Thumbnails
  • ltcfpdf
  • action"thumbnail"
  • format"png"
  • resolution"high"
  • overwrite"yes"
  • source"test.pdf"
  • destination"ExpandPath('.')/thumbs"
    transparent"no"
  • scale"30"gt

14
Working with PDF
  • Server Side Printing
  • ltcfset aSetStructNew()gt
  • ltcfset aSet"paper" "letter"gt
  • ltcfset aSet"sides" "duplex"gt
  • ltcfset aSet"copies" "5"gt
  • ltcfset aSet"printer" "\\myserver\myprinter"gt
  • ltcfprint type"pdf" source"test.pdf"
    attributeStruct"aSet"gt

15
PDF Forms
  • Populating PDF form
  • Prefilling PDF forms
  • Form embedding
  • Data extraction from PDF form
  • Adobe Acrobat forms
  • XML Forms Data Format (XFDF)
  • Adobe LiveCycle Designer
  • XML Forms Architecture (XFA)

16
Resources
  • Adobe PDF Technology Center
  • http//www.adobe.com/devnet/pdf/
  • Livedocs http//livedocs.adobe.com/coldfusion/8/ht
    mldocs/help.html?contentformsPDF_01.html
  • PDFUtils Custom Tag (Ray Camden)
  • http//pdfutils.riaforge.org
  • MXNA (search as PDF)
  • http//weblogs.macromedia.com/mxna/

17
Questions Answers?
  • oguz_at_teratech.com
Write a Comment
User Comments (0)
About PowerShow.com