Menu:

Sponsor

Discover Master of Alchemy, our first iPad/iPhone and iPod touch game!

Follow Me

 

Forum's topics

Latest Files

Archives

Top Rated

Categories

Photo Gallery


Alessandro Crugnola on February 3, 2010 in actionscript , flex , general , purePDF

purePDF, a complete actionscript PDF library

PurePDF is a complete library for creating PDF documents using actionscript 3 ( targeted for flash player 10 ). The project is actually hosted on google code.

This is is a porting I've made of the famous java iText library ( version 4.2 ) by Bruno Lowagie into pure actionscript 3.0 (with some little modifications).
iText ( and purePDF ) has tons of features for create and manipulate pdf documents. A quick list of the features actually implemented into purepdf:

  • pdf viewers display options
  • alpha transparency, blend modes
  • layers
  • arabic RTL writing
  • support for pdf text rendering ( example )
  • tables ( nested tables, page split tables, table with images, etc...)
  • slide show ( page transitions )
  • annotations, comments, file annotations
  • patterns, shadings patterns (linear and gradient), spot colors, rgb color and cmyk color
  • linear and radial gradients with alpha ( example or example 2 )
  • forms (user input forms, textfields, combo box, list, checkbox)
  • paragraphs, phrases, chunks for text manipulation, chapters, lists...
  • images (jpeg, png, animated gif, tif, bitmapdata ) and image patterns
  • basic and advanced paths
  • afm, otf, pfm, ttc and ttf fonts (embedded and not embedded)
  • metadata, page header and footers
  • external, internal links
  • barcodes creation ( ean-ucc 13, ucc-12, ean-ucc-8, upc-e, pdf 417, ean supplements) ( example )
  • unicode, cjk fonts and text
  • file attachments
  • javascript ( example )
  • multi column text
  • Embedded movies ( example )
  • Vertical text ( see this example )
  • and many other features...

You can take a look at this PDF document (self generated using actionscript reflection) with the purePDF APIs.

Other actionscript libraries I've used for this project are: fzlib, as3corelib, ashashmap, alchemy, as3-commons.

You can both download the library from source code and compile it yourself ( see at the Installation guide ) or download the precompiled swc files from the project's download section.

Moreover there are actually a lot of examples to explain all the library features and for a quick guide. You can find them listed and updated here. In General refers to the project wiki for all the updated examples/howtos and the project updates.

update: here you can find the updated online api documentation



 

Bookmark and Share

 

Tags: actionscript , java , library , pdf , purepdf 

 

11 comments
If you're already using iText on your server for PDF generation purePDF doesn't help you. purePDF is a porting of iText so the only benefit I can see in your situation is that you will be able to generate the pdf within the client swf instead of stressing the remote server. BTW, purePDF should work exactly like iText. Btw I don't see the problem with formatting a flash textarea into pdf with the same formatting. Are you having problems with this task?
Hi, I have a need to render wysiwyg text entered into a flex AS3 application into PDFs with the text formatting matching exactly what the customer entered. I don't need to render PDFs directly from the flex application. Our flex app writes details about the customer's creation (page layouts, photos used, text used) + the text formatting into XML and sends it to back-end servers. It is then rendered downstream into high quality print-ready PDFs. My issue is guaranteeing formatting consistency between the flex app and the PDF. Currently we use the standard Adobe textarea controls in flex and iText. Can PurePDF help with this problem?
WoW! Thanks for this and the rest of your site. I use it over and over. Do you have any suggesting for rending an MXML component to a pdf? Right now I am using alivePDF which is essentially a png grab. It struggles with quality and makes a real mess of scrolled and paged results.
There's nothing particular in alchemy, just a couple of utility scripts to emulate C union and a static vector declaration because in flash it would cause a stack overflow. Anyway, iText is in java, right, but many of the java methods are native C.
Alessandro, that's amazing - thanks for your great work! At the purepdf project on Google Code I have found some Alchemy stuff. Why did you need Alchemy, because iText is based on Java, isn't? Again, great work! -Jens
Great Alessandro ! Is it also possible to submit forms and get back the filled values ? Thanks a lot
This is a very necessary thing. Thank you!
Actually, regarding generating to flash paper. Even cooler would be to use this open source viewer which is like flashpaper but better really; http://www.devaldi.com/?page_id=260
Great job. Is the PDFStamper class implemented? I coulldn't find it in the documentation.
This is awesome. It's really filling a gap. Thanks a *lot*.
Could PurePDF be used to generate Flash Paper? It would be really great if PDF libs like PurePDF and AlivePDF also generated Flash Paper using the same API. Then users could do print previews and print directly from Flash.


Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Type the characters you see in the picture above.





 

TrackBacks

TrackBack URL for this entry: http://www.sephiroth.it/cgi-bin/mt/mt-tb.cgi/283

Listed below are links to weblogs that reference purePDF, a complete actionscript PDF library:

» purePDF, a complete actionscript PDF library from alittleb.it srl - Technology driven business solution
Alessandro, alittleb.it co-founder, has just released an incredible actionscript PDF library. Chek out  purePDF on our tech-blog. Great work Alessandro!!! ... [Read More]

» Social comments and analytics for this post from uberVU - social comments
This post was mentioned on Twitter by togishi: Cool: PurePDF, a complete #as3 PDF Library: http://bit.ly/9PPQTX [Read More]