pal pdf automation language the team anshuman singh
play

PAL: PDF Automation Language The Team Anshuman Singh Diksha - PowerPoint PPT Presentation

PAL: PDF Automation Language The Team Anshuman Singh Diksha Vanvari Vinay Gaba Viral Shah Why does PDF creation require its own programming language? Thats Why! Nuts & Bolts Compiles to Multiple PDF Support for Useful Standard


  1. PAL: PDF Automation Language

  2. The Team

  3. Anshuman Singh Diksha Vanvari Vinay Gaba Viral Shah

  4. Why does PDF creation require its own programming language?

  5. That’s Why!

  6. Nuts & Bolts

  7. Compiles to Multiple PDF Support for Useful Standard Java Operations Map/List Library

  8. Objectives

  9. Make it easy to generate pdfs from strings, textfiles, existing pdfs and tables ● (charts) Find the right balance between a programming language and a markup ● language Provide granular(line level) control to the user ● At the same time, provide high level constructs in the Standard Library which ● take away the pain of writing the pdf at a granular level. ○ Paragraph level - write_paragraph(...) ○ Page level - write_column_layout(...) ○ PDF level - write_pages(...)

  10. Speak the Language! Woof

  11. Syntax Loops Comments #This is a single line comment for(i=0;i<5;i=i+1){ /* awesome = awesome + 1; This is } a multi while(i<5){ line comment awesome = awesome * 5; */ }

  12. Primitives and Predefined Constructs General Primitives PDF Primitives and Constructs intVar:int = 42; pdfVar:pdf; stringVar:string = “COMS 4115”; pageVar:page; boolVar:boolean = false; tupleVar:tuple(pdfVar,pageVar); floatVar:float = 4.5; lineVar:line(s,f,sz,x,y,w); imageVar:image(s,h,w,x,y);

  13. List Data Type List Type Inference List Operations intList : list int; int_l : list int; intList += 5; int_l_l : list list int; intList -= [0]; int_l_l_l : list list list int; intList[0] = 4; List of ‘int’ -> ‘AA” List of ‘AA’ -> ‘AI’ List of ‘AI’ -> ‘AJ’

  14. Map Data Type Map Type Inference Map Operations int_sl_m : map int,list string; int_sl_m : map int,list string; m += 5, “PAL”; List of ‘string’ -> ‘AB’ Map of int,string -> int, ‘AB’ m -= 5; s : string = m:=4;

  15. Primitive Functions readtext(...) / readtable(...) loadpdf(...) / split(...) drawpiechart(...) / drawbarchart(...) substr(...) / length(...) getpages(...)

  16. Standard Library write_paragraph(...) write_two_column_layout(...) write_three_column_layout(...) write_4grid_layout(...) write_pages(...)

  17. Let’s get our hands dirty, shall we?

  18. Hello World! main(){ pdfVar : pdf; pageVar : page; pageVar = pdfVar . pageVar; tupleVar : tuple(pdfVar,pageVar); lineVar : line ("Hello World!", "TIMES_ROMAN" , 12 , 100, 700, 500); tupleVar = tupleVar . lineVar; renderpdf(pdfVar,”helloworld.pdf”); }

  19. 3 Lines to generate a multi-page PDF import ("stdlib.pal"); main(){ stringVar:string = readtextfile(filepath); pdfVar:pdf = write_pages(stringVar,14,"TIME_ROMAN","THREE_COLUMN"); renderpdf(pdfVar,"multipages.pdf"); }

  20. 80%* That’s the amount of lines PAL helps you reduce over Java * - on average

  21. Demo Time!

Recommend


More recommend