pdf generation using PTT Armando Maglio IT Architect

  • Slides: 14
Download presentation
. pdf generation using PTT Armando Maglio IT Architect, Global Web Solutions, ibm. com

. pdf generation using PTT Armando Maglio IT Architect, Global Web Solutions, ibm. com © 2007 IBM Corporation

ibm. com YOU HAVE THE POWER . pdf file generation process . tags Bluemix

ibm. com YOU HAVE THE POWER . pdf file generation process . tags Bluemix service text 2 9/2/2021 © 2006 IBM Corporation

ibm. com YOU HAVE THE POWER About this document Abstract: This document describes the

ibm. com YOU HAVE THE POWER About this document Abstract: This document describes the PDF(*) generation methodology using a Java library with a brief technical implementation guide for the PTT (**) modeling. What this document covers This document covers the technical approach and provides guidance with syntax help and examples for the creation of PDF templates. Overview of the technical approach to PTT. Intended audience for this document PDF modelers. (*) PDF: Portable Document Format (**) PTT: PDF Text Template 3 9/2/2021 © 2006 IBM Corporation

ibm. com YOU HAVE THE POWER PTT library The PTT library supports the generation

ibm. com YOU HAVE THE POWER PTT library The PTT library supports the generation of PDFs. It allows to easily create high volume / high quality customized PDFs based on simple text templates. The library functions include: § Text: § Fonts, styles, language codes, colors, tables, lists, paragraphs alignment, dynamic pages numbering § Graphic: § Images, colors, lines, shapes (circle, rectangle, oval, arc) § Bar codes (code 39, QR) § Dynamic header / footer (including tables, images) § Encryption / Permissions / Password protected access 4 9/2/2021 © 2006 IBM Corporation

ibm. com YOU HAVE THE POWER Technical overview The PTT capabilities are intended to

ibm. com YOU HAVE THE POWER Technical overview The PTT capabilities are intended to quickly deliver PDF using Post. Script-like tags. The advantages of this approach are: § Easy usage of simple tags with text editors (notepad) § Efficient maintenance and enhancement of functional engine capabilities § Debug § Light code 5 9/2/2021 © 2006 IBM Corporation

ibm. com YOU HAVE THE POWER PTT (PDF Text Template) 1. Tags list –

ibm. com YOU HAVE THE POWER PTT (PDF Text Template) 1. Tags list – examples 2. Supported fonts 6 9/2/2021 © 2006 IBM Corporation

ibm. com YOU HAVE THE POWER Tags list - 1 Examples Description . tit=PDF

ibm. com YOU HAVE THE POWER Tags list - 1 Examples Description . tit=PDF Title. d. z. inc=styles. ptt. st 1=. cpb 50. lm 60. st 1. lc[ww pl cz]. ph line 1 line 2. ep. foar, p, [10][, #0000 FF]. fs 12. j[lcrb]. red. green. blue. black. white. ct 0, 0, 255. ct#0000 FF . tit=PDF Title. d (debug on/off). z (use compression). inc=FILENAME (include file). st. STYLE=SEQUENCEOFTAGS (style) (use style 1). lc. LANGUAGECODE. ph (start paragraph) line 1 line 2. ep (end paragraph). fo. FONT, STYLE, [SIZE], [COLOR] (*). fs. FONTSIZE. j (left, center, right, box) (justify text) text colors. ct. R, G, B (text color RGB 0 -255) * font styles: p (plain) b (bold) i (italic) bi (bolditalic) 7 9/2/2021 © 2006 IBM Corporation

ibm. com YOU HAVE THE POWER Tags list - 2 Examples Description . xy

ibm. com YOU HAVE THE POWER Tags list - 2 Examples Description . xy 300, 30. cpb 100. lm 40. rm 40. sp 18. u[0, 255, 0] . xy[X], [Y] (text coordinates). xy 0, 0 = bottom left, . xy 595, 842 = top right. cpb. Y (conditional page break). lm. LEFTMARGIN. rm. RIGHTMARGIN. sp. Y_OFFSET (text offset down). u[R, G, B] (line, underline) Ciao Text . yb 40. yt 40 . yb. BOTTOMMARGIN (y-axis bottom margin). yt. TOPMARGIN (y-axis top margin) . hf Start header / footer . xy 30, 750. jc Header. xy 30, 40. jr _P_ / _TP_ text and tags . eh 8 End header / footer 9/2/2021 © 2006 IBM Corporation

ibm. com YOU HAVE THE POWER Tags list - 3 Examples Description (GRAPHICS) 9

ibm. com YOU HAVE THE POWER Tags list - 3 Examples Description (GRAPHICS) 9 . cg 0, 255, 0. bg 0, 255, 0. pb#f 0 ffff. w. 5. ln 100, 10, 300, 600[, #0000 FF]. circ 288, 216, 72[, #000080]. oval 100, 300, 200[, #000080]. arc 300, 360, 120, 295, 15[, #7 FFF 00]. rect 100, 200, 100, 50[, #0000 FF] . cg. R, G, B (graphic color RGB 0 -255). bg. R, G, B (cell background color RGB 0 -255). pb#RRGGBB (page background). w. W (graphic width). ln. X 0, Y 0, X 1, Y 1[, #RRGGBB] (line). circ. XC, YC, R[, #RRGGBB] (circle). oval. X 0, Y 0, X 1, Y 1[, #RRGGBB] (oval). arc. XC, YC, R, STARTANGLE, ANGLE[, #RRGGBB]. rect. X 0, Y 0, W, H[, #RRGGBB] (rectangle) . img=http: //www. prime-news. info/wp-content/uploads/ibmlogo. jpg, 50, 78, 100, 300 Jpeg image. img=URL, X 0, Y 0, [W[%], H[%]] . bar=Armando Maglio . bar=BARCODE (code 39 barcode) . qr. sz 120 Line 1. eq Start QR 2 d barcode QR size QR text End QR 2 d barcode 9/2/2021 © 2006 IBM Corporation

ibm. com YOU HAVE THE POWER Tags list - 4 10 Examples Description .

ibm. com YOU HAVE THE POWER Tags list - 4 10 Examples Description . # Comment . # This is a comment . tb 3, 1, 100, 200. row Text xxx. b. et 0. li-. li • . li 1. lia line 1 line 2. el. p . tb. COLUMNS, BORDERSWIDTH, COLSWIDTH (new table). row (start new row) cell 1 (text). b (blank, empty cell). et[X] (finalize table, X points before next table). li. CHAR (list). li. NUMBER. li. CHAR (ordered list) listmember 1 listmember 2. el[X] (end list). p (finalize page) . prm=10100000. pwd=Password Permissions: Print Modify Copy Modify. Annot. Fill. In Screen. Readers Assembly Degraded. Printing 9/2/2021 Password to open the PDF © 2006 IBM Corporation

ibm. com YOU HAVE THE POWER Tags list - 5 Examples Description (edit mode)

ibm. com YOU HAVE THE POWER Tags list - 5 Examples Description (edit mode) 11 . tl 10. tx. Abc 123. tx . tl. LENGTH (input text length). tx. TXT (input text). tx (empty text) . cb. CB 1. cb. CB 2 . cb. TXT (new checkbox) . rb RB 1 RB 2. er . rb (start new radiobutton list) Radio option 1 Radio option 2. er (end radiobutton list) (table of contents). tc 1 . tc. N (to be used e. g. in Index _TC 1_ ) 9/2/2021 © 2006 IBM Corporation

ibm. com YOU HAVE THE POWER Supported fonts 12 Code Font he tr ar

ibm. com YOU HAVE THE POWER Supported fonts 12 Code Font he tr ar co lc cm ve zd ms ca Helvetica Times. New. Roman Arial. MT Courier. New. PSMT Lucida. Console Comic. Sans. MS Verdana Zapf. Dingbats Montserrat Calibri 9/2/2021 © 2006 IBM Corporation

ibm. com YOU HAVE THE POWER Implementation Overview: Dynamic fields The purpose of dynamic

ibm. com YOU HAVE THE POWER Implementation Overview: Dynamic fields The purpose of dynamic fields it to substitute fields with values provided by the user application. Dynamic fields are in the format _FIELDNAME_ Some dynamic fields are predefined in the PDF library: _P_ page number _TP_ total pages _TODAY_ today’s date dd/mm/yyyy _USTODAY_ today’s date mm/dd/yyyy 13 9/2/2021 © 2006 IBM Corporation

ibm. com YOU HAVE THE POWER Usage as a service The library can be

ibm. com YOU HAVE THE POWER Usage as a service The library can be used as a service. A user application can POST a PTT and get back the PDF as a string. The PTT must be encoded. Example in VBA: Set req = Create. Object("MSXML 2. XMLHTTP") req. Open "POST", "http: //am 1. ng. bluemix. net/pdf. jsp", False req. send "ptt=" + encode(ptt) resp = req. response. Body pdf= Str. Conv(t, vb. Unicode) 14 9/2/2021 © 2006 IBM Corporation