online cheap medications order generic bactrim price, and buy cheap online buy cheap discount lasix, and cheap pharmacy lipitor without rx, and online ordering accutane review, and order cheap how much acyclovir to kill, and buy cheapest synthroid order online, and pharmacy cheapest cheap baclofen pill, and order online directions for taking clomid, and online cheap medications cheap hydrochlorothiazide without rx, and cheap pharmacy purchase amoxil cod overnight delivery, and cheap pharmacy arimidex online overnight, and buy cheap online buy buy zithromax pill online, and order online online valtrex prescription in utah, and buy cheapest buy cheap discount online flagyl, and buy online zovirax (acyclovir) cheapest, and buy cheap how to buy prozac online without a rx, and cheap pharmacy cash on delivery paxil, and cheap pharmacy diflucan cod delivery next day, and purchase no prescription propecia cancer prevention, and generic medications neurontin and online overnight delivery, and purchase no prescription norvasc fedex shipping, and online ordering purchase doxycycline next day cod, and ordering online feminizing effects of premarin, and buy cheap online buspar and wellbutrin, and online cheap medications order overnight retin-a, and

AlivePDF : Video Tutorial N°2

AlivePDF Tutorial N°1 - Getting started

Here is another video tutorial about generating a PDF with AlivePDF from a Flex application.

I hope you'll like it Eric ;)

More to come with a new release ;)

Comments 41

  1. Aaron Buchanan wrote:

    Great stuff! Thank you! Looking forward to seeing how powerful/flexible this will be!

    Can we add user-generated vectors / bitmaps to the file? Regarding fonts – do they have to be installed to the webserver?

    Posted 01 Dec 2007 at 10:46 pm
  2. Thibault Imbert wrote:

    Hi Aaron,

    You can add user generated bitmaps as soon as you pass them to the addImage method as a flash.display.Bitmap.

    Would you like to be able to load them dynamically ? Like passing an URLRequest object to the addImage method ?

    Concerning vectors, I am currently thinking about a cool solution for Flash and Flex people. But it’s not supported for the moment. This will be added in a near future :)

    Regarding fonts, adding custom fonts is an upcoming feature. I am thinking about 2 solutions. First, you will be able to put the .ttf files on the server AlivePDF will parse it and include it.

    Second, you will generate an XML description of the font so that AlivePDF can include it.

    Is that ok for you ?

    kind regards,

    Thibault

    Posted 01 Dec 2007 at 10:55 pm
  3. Christoph Guse wrote:

    Hi Thibault,

    very impressive work and it exactly what I need at the moment :-)
    My app is a reporting app which has several views for the same in a tab-navigation ( DataGrid as initial view, several Charts ). In my testcase I created a PDF with a image, the image is created out of one of the Charts.
    In my tests there is a problem with the proportions of the chart when the chart is not displayed.

    Do you know a workaround for this issue?

    Regards,
    Christoph

    Posted 03 Dec 2007 at 6:46 pm
  4. Thibault Imbert wrote:

    Hi Christoph,

    I am happy to hear that you are using AlivePDF :)

    What kind of problems do you have concerning the proportions ? Can you show me and example ?

    kind regards,

    Thibault

    Posted 03 Dec 2007 at 7:08 pm
  5. Christoph Guse wrote:

    Hi Thibault,

    of course I can send you an example. Please send me a short mail so I have your mail address and I will send you two PDF files: one with the problem and one which shows how it should look like.

    Regards,
    Christoph

    Posted 04 Dec 2007 at 12:35 pm
  6. Christoph Guse wrote:

    Hi Thibault,

    is there some example available, which creates a DataGrid ( not as Image ) in a PDF?

    Regards,
    Christoph

    Posted 04 Dec 2007 at 5:33 pm
  7. Serban Dan wrote:

    Do you have the code to make this working with Cookie like you showed into your example. I can not make it work with cookies. I am trying for 2 days. Help!!!

    Posted 05 Dec 2007 at 12:43 pm
  8. Thibault Imbert wrote:

    Hi Serban,

    What do you mean with cookies ?

    kind regards,

    Thibault

    Posted 08 Dec 2007 at 2:26 pm
  9. jms wrote:

    Hi,

    I tried implementing the way u’ve mentioned in ur tutorial-2 [Flex].

    I am not very clear with the functionality of create.php and how shall deploy it on the app-server, so that it acts a server element.

    Posted 12 Dec 2007 at 12:31 pm
  10. jms wrote:

    FYI: I am using weblogic application server.

    Posted 12 Dec 2007 at 1:04 pm
  11. jms wrote:

    can i do away with the create.php by doing something like this; — Out here am sending the serverData [String] to the Servlet and retriving it back as the response object. [I havent converted to the byte array]

    But the pdf generated says “not supported file tyep or b’coz the file is damaged”

    pdf = new PDF(Orientation.PORTRAIT, Unit.MM ,Size.A4);

    pdf.addPage();

    pdf.addPage(Orientation.LANDSCAPE,Unit.MM,Size.A5);

    // Not using the savePDF [using weblogic therefore avoiding php ] … instead used part of savePDF API here ….

    var header:URLRequestHeader = new URLRequestHeader (“Content-type”, “application/pdf”);
    var myRequest:URLRequest = new URLRequest (); // Server_URL+’?name=’+”mypdf.pdf”+’&method=’+”attachment” );

    myRequest.url=Server_URL;
    myRequest.requestHeaders.push (header);
    myRequest.method = URLRequestMethod.POST;

    myRequest.data = new URLVariables (“data=” + escape(serverData));

    navigateToURL ( myRequest, “_blank” );

    Appreciate any inputs ….

    Thanks in advance

    Posted 12 Dec 2007 at 6:00 pm
  12. Thibault Imbert wrote:

    Hi jms,

    I will post tomorrow a Java Servlet to save the PDF properly with J2EE :)

    kind regards,

    Thibault

    Posted 16 Dec 2007 at 4:34 pm
  13. TE wrote:

    Thibault — thanks! Any examples for using this with a J2EE environment would be great to have.
    I use Tomcat, WebLogic, WebSphere and JBoss, so anything would be great.

    PS — is it possible to make one of the FLex charts I show in my flex app to appear in the output PDF I create?

    Posted 16 Dec 2007 at 11:48 pm
  14. jms wrote:

    Thanks Thibault :-)

    Posted 17 Dec 2007 at 8:49 am
  15. Thibault Imbert wrote:

    Hi TE,

    Nice idea, yes I can do that set up some J2EE examples.
    I will work on that :)

    Concerning the Flex Charts, what you can do for the moment is call the addImage method and pass your chart, then you will get a picture of your flex chart in the final PDF.

    If you are looking for some vectors in the final PDF, you will have to wait a little bit. I will introduce something nice really soon. I can’t talk about it for the moment :)

    kind regards,

    Thibault

    Posted 18 Dec 2007 at 1:27 pm
  16. tb wrote:

    never mind — there is no need for me to create the bitmap — I can just pass the datagrid or chart as you said.
    Thanks!

    Posted 19 Dec 2007 at 8:58 pm
  17. Thibault Imbert wrote:

    Hi tb,

    yes ! ;)

    kind regards,

    Posted 19 Dec 2007 at 9:02 pm
  18. Kevin wrote:

    Is there any sample code out there that I can look at to figure out how to layout cells on a page. I am trying to use addCell and it is not working for me. Here is an example:

    I am just trying to lay out cell horizontally. This is how I understand it should be done.

    BUT This does NOT work (for me):

    var myPDF : PDF = new PDF(Orientation.PORTRAIT,Unit.MM,Size.LETTER);
    myPDF.addPage(Orientation.PORTRAIT);
    myPDF.setFont(FontFamily.HELVETICA, ‘B’, 12);
    myPDF.textStyle ( new RGBColor ( 255, 0, 0 ) );
    myPDF.addCell(50,10,’Some text into a cell !’,1,0);
    myPDF.addCell(50,10,’More text into a cell !’,1,0);
    myPDF.addCell(50,10,’Last text into a cell !’,1,0);

    However this works to lay them out vertically:

    var myPDF : PDF = new PDF(Orientation.PORTRAIT,Unit.MM,Size.LETTER);
    myPDF.addPage(Orientation.PORTRAIT);
    myPDF.setFont(FontFamily.HELVETICA, ‘B’, 12);
    myPDF.textStyle ( new RGBColor ( 255, 0, 0 ) );
    myPDF.addCell(50,10,’Some text into a cell !’,1,1);
    myPDF.addCell(50,10,’More text into a cell !’,1,1);
    myPDF.addCell(50,10,’Last text into a cell !’,1,1);

    What am I doing wrong to create horizontal cells?

    - Kevin

    Posted 21 Jan 2008 at 7:03 pm
  19. Thibault Imbert wrote:

    Hi Kevin,

    you fixed it ;)

    hehe tks !

    regards,

    Thibault

    Posted 22 Jan 2008 at 12:27 am
  20. bluejay wrote:

    i had also the same problem of formatting cells horizontally.

    what i did, temporarily, is create an object then addImage… this is somewhat a wrong processs i know but nothing comes to aid.

    also, the documentation has errors on addCell.

    anyone who knows how?

    Posted 26 Jan 2008 at 9:11 am
  21. Thibault Imbert wrote:

    Hi bluejay,

    you can use this fix to use the addCell method properly :

    http://code.google.com/p/alivepdf/issues/detail?id=24

    This issue has been fixed in the next release,

    regards,

    Thibault

    Posted 26 Jan 2008 at 12:25 pm
  22. Anish wrote:

    Hi Thibault,

    AlivePDF is really a pretty useful library. Great work and many thanks for getting it out.

    I have seen many people asking for generating PDF from a datagrid. I had a similar requirement. I took Datagrid to CSV exporter created by Abdul (http://www.abdulqabiz.com/blog/archives/flash_and_actionscript/datagriddataexporter.php) and modified it slightly to export the datagrid as PDF. May be it will be useful to others too. Here is the code:-

    /*** Start Of DataGridDataExporter.as ***/
    _________________________________________________________________________________________________________________

    DataGridDataExporter is a util-class to export DataGrid’s data into different format.
    @class DataGridDataExporter (public)
    @author Abdul Qabiz (mail at abdulqabiz dot com)
    @version 0.01 (2/8/2007)
    @availability 9.0+
    @usage

    DataGridDataExporter. (dataGridReference)

    @example

    var csvData:String = DataGridDataExporter.exportCSV (dg);

    __________________________________________________________________________________________________________________

    */
    package com.abdulqabiz.utils
    {
    import mx.collections.IViewCursor;
    import mx.controls.DataGrid;
    import mx.controls.dataGridClasses.DataGridColumn;

    import org.alivepdf.annotations.StampStyle;
    import org.alivepdf.fonts.FontFamily;
    import org.alivepdf.fonts.Style;
    import org.alivepdf.layout.Orientation;
    import org.alivepdf.layout.Size;
    import org.alivepdf.layout.Unit;
    import org.alivepdf.pdf.PDF;
    import org.alivepdf.saving.Download;
    import org.alivepdf.saving.Method;

    import org.alivepdf.colors.RGBColor;

    public class DataGridDataExporter
    {

    public static function exportCSV(dg:DataGrid):String
    {
    var data:String = “”;
    var columns:Array = dg.columns;
    var columnCount:int = columns.length;
    var column:DataGridColumn;
    var header:String = “”;
    var headerGenerated:Boolean = false;
    var dataProvider:Object = dg.dataProvider;

    var rowCount:int = dataProvider.length;
    var dp:Object = null;
    var myPDF:PDF;

    myPDF = new PDF (Orientation.PORTRAIT, Unit.MM, Size.LETTER);
    myPDF.addPage();
    myPDF.setTitle(“MY PDF”);
    myPDF.setFont(FontFamily.ARIAL,Style.BOLD,16);
    myPDF.setAuthor(“ITS ME..!”);
    myPDF.setCreator(“ME”);
    myPDF.setLeftMargin(5);
    myPDF.setRightMargin(5);
    myPDF.setSubject(“Report PDF”);
    myPDF.setTopMargin(5);
    myPDF.setXY(5 ,5);
    myPDF.writeText(12,”This will be the datagrid title”);
    myPDF.setXY(5 ,15);
    myPDF.setFont(FontFamily.ARIAL,Style.NORMAL,11);

    var cursor:IViewCursor = dataProvider.createCursor ();
    var j:int = 0;
    var strLimit:String = “”;
    //loop through rows
    while (!cursor.afterLast)
    {
    var obj:Object = null;
    obj = cursor.current;
    strLimit = “”;
    //loop through all columns for the row
    for(var k:int = 0; k < columnCount; k++)
    {
    column = columns[k];

    //Exclude column data which is invisible (hidden)
    if(!column.visible)
    {
    continue;
    }

    strLimit += ” “+ column.itemToLabel(obj)+ ” “;

    strLimit += “\n”;

    }

    headerGenerated = true;

    j++;
    cursor.moveNext ();

    myPDF.addCell(200,strLimit.length/4,strLimit,1,1, null, 0);

    }

    //set references to null:
    dataProvider = null;
    columns = null;
    column = null;
    myPDF.savePDF(Method.REMOTE,”http://localhost/create.php”,Download.ATTACHMENT,”myPDF.pdf”);

    return (header + “\r\n” + data);
    }
    }

    }
    /* End of DataGridDataExporter.as*/

    Posted 28 Feb 2008 at 4:10 pm
  23. Anish wrote:

    In the above PDF exporter, it has a slight problem, in that if the column data is too lengthy, then the lines go out of the PDF. Working on to fix that issue.

    -Anish

    Posted 28 Feb 2008 at 4:14 pm
  24. Michael van Leest wrote:

    Great stuff! This realy save me a lot of time to let users create their own PDF’s on the intranet instead of heavy server scripts!

    If you want I could create a Coldfusion version of your PHP file if you want? Email me if you need it…

    Thanks a million for this great work!

    Michael

    Posted 07 Mar 2008 at 1:21 am
  25. Rick wrote:

    Hi Thibault,

    J’ai un problème avec addimage… je n’ai pas dû en saisir la syntaxe… Lorsque je lance ce qui suit, il ne se passe rien dans ma page web, alors que si j’enleve addimage, cela fonctionne… probablement une erreur ?

    public function generatePDF(pEvt:MouseEvent):void
    {
    myPDF = new PDF(Orientation.PORTRAIT, Unit.MM, Size.A4);
    myPDF.addPage();

    etc…

    var ima:Image= new Image();
    ima.source = “assets/fond.jpg”;
    myPDF.addImage(ima, 1 , “Normal”, null , false, “JPG”, 100, 0, 0, 0, 0);

    //Saving
    etc…
    }

    Posted 10 Mar 2008 at 6:18 pm
  26. David wrote:

    Anybody have some example of loading and image from file system in Adobe Air, and use addImage to put this image on PDF.

    thk.
    Giro.

    Posted 18 Mar 2008 at 10:17 pm
  27. Vivek wrote:

    i want to add a small image as logo in pdf document. Can anyone plz tell me how to do this? following are my line of codes which i have tried:
    [Embed( source="/assets/logo2.PNG", mimeType="application/octet-stream")]
    public var pngBytes:Class;
    pdf.addImageStream( new pngBytes() as ByteArray, 0, 0, 0, 0, 1, ImageResize.RESIZE_PAGE );
    //pdf.addImage ( new pngBytes() as DisplayObject, 0, 0, 0, 0, ImageFormat.JPG, 100, .2 );

    Thanks & Regards,
    Vivek

    Posted 25 Jun 2008 at 12:33 pm
  28. Jake wrote:

    Thanks for sharing. This is a great library. Keep it up.

    Any news on the ability to add a swf or vector to a PDF, so that it keeps from pixelating when you zoom in?

    I’m trying to improve our pdf quality. Currently adding charting components as images seems to pixelate and blur slightly, especially when viewing them in fixit instead of acrobat.

    Posted 12 Jul 2008 at 1:37 am
  29. bflophil wrote:

    Could you create a coldfusion version of the create.php file.

    Thanks
    Phil

    Posted 25 Oct 2008 at 12:00 am
  30. vishnu wrote:

    Hi Thibault,

    Thanks alot for this wonderful library. I was using this library with struts on the server side and found that if we already have a parameter in the url that is passed , it can cause an issue

    So now i changed the code as below
    in save function in org.alivepdf.pdf.PDF.as. Thought of sharing this with you

    var myRequest:URLRequest;
    if (url.indexOf(“?”,0) < 0) {
    myRequest = new URLRequest ( url+’?name=’+fileName+’&method=’+downloadMethod );
    } else {
    myRequest = new URLRequest ( url+’&name=’+fileName+’&method=’+downloadMethod );
    }

    Thanks
    Vishnu

    Posted 27 Feb 2009 at 3:14 am
  31. Kalen Gibbons wrote:

    For those of you who are interested in using ColdFusion with AlivePDF, I’ve posted a cfm version of the create.php script on my blog.

    http://www.kalengibbons.com/blog/index.php/2009/03/custom-printing-with-flex-part-2-generating-pdfs-with-alivepdf/

    I hope it helps!

    Thanks,
    Kalen

    Posted 02 Mar 2009 at 11:51 pm
  32. Corey Nolet wrote:

    I’m using this library professionally at the moment. I was asked to create a front in flex that will allow project management to generate a report including a bunch of scaffold details and the flex charting.

    All of this is irrelevant, however, as I can’t even seem to get the header logo image to render correctly. I have tried this both as a png and a jpg and seem to get the same results.

    The problem is that the image quality blurs the image on the pdf. When I save the image in photoshop, it is very crisp and precise but when I render it (using addImageStream) to the pdf, it is too blurry to give to a customer.

    How can I fix this? I love this library but this is holding the software back.

    Posted 20 Jun 2009 at 11:05 pm
  33. Geetha Narayan wrote:

    I have several charts and datagrids, how will i transfer everything in one pdf, can you give me an example how to add the chart i have to pdf format? i have spent a lot of time finding this… but couldnt get a good solution, can any one help me with it?
    thanks,
    Geetha

    Posted 22 Sep 2009 at 8:04 pm
  34. Stanislav Zayarsky wrote:

    Hi, I wonder whether it is possible to use custom font already?

    Posted 05 Oct 2009 at 5:32 pm
  35. Fredrik Borgström wrote:

    Where are the source files that you talk about in the video???

    Posted 03 Feb 2010 at 12:26 am
  36. Viktor Stevich wrote:

    Thanks for Thibault Imbert for the AlivePDF library which is saving a lot of time.

    Now for the cells horizontally what you can do is:

    1. you add first the cell,
    2. set the XY -> after the cell
    3. add the second cell

    This is how they are going to be horizontally lined up

    Posted 09 Mar 2010 at 7:00 pm
  37. Viktor Stevich wrote:

    The Code example:

    yourPDF.addCell(0,0,”Problems”,1,1); yourPDF.setFontSize(8); yourPDF.setXY(50,tanPDF.getY());
    yourPDF.addCell(0,0,”Difficulties the customer has that I could solve.”,1,1);

    This is going to create two cells horisontaly.

    Cheers

    Posted 09 Mar 2010 at 7:20 pm
  38. ren wrote:

    I have a requirement in my project where I have to put all my CHARTS and DataGrids in a PDF at client side. This is an AIR application. I found there are many people working on similar type of application. Can somebody post links or sample programs of this type. Also you can them to me at my email nikh1307@yahoo.com

    Your help is highly appreciated. Thanks in advance

    Posted 25 Mar 2010 at 2:49 am
  39. s.karthik wrote:

    Hi,
    Can anyone tell me how to print image in the pdf header.
    Iam new to this lib.
    pls send me the code if anyone have to akash_karthik { at } yahoo dot co dot in. Thanks in advance.

    Posted 08 May 2010 at 4:36 pm
  40. csri wrote:

    Hi Thibault,

    Thank you for creating this lib!!! I am trying to create a pdf page from a flex web application with alivepdf. I want to add an image and here is what am doing ..

    var hdrImg:Image=new Image;
    hdrImg.source=”assets/header.PNG”

    printPDF.addImage(hdrImg.content,0.5,0.5,0.65,0.65,”PNG”,100,1,ResizeMode.NONE,BlendMode.NORMAL,true,”"); ////Getting an error

    I have not been able to use the addimagestream method successfully either, as I cant figure out how to convert hdrImg to bytearray. Could you please show me how to convert hdrImg to bytearray?

    what would be the best way to add “hdrImg” to the pdf page?

    Thank you in advance for any help..

    Posted 24 Sep 2010 at 6:22 pm
  41. Angela wrote:

    I am getting a damaged pdf if the file is over 200kb. Any ideas?

    var pdf:PDF = new PDF(Orientation.PORTRAIT, Unit.MM, Size.LETTER);
    var page:Page = new Page( Orientation.PORTRAIT, Unit.MM, Size.LETTER );

    var y_position:Number = 20;
    var x_position:Number = 20;
    var referenceX:Number = 20;
    var lastY_position:Number;
    var maxLocations:Number = 7;

    // can only display the first 10 because of size bug
    if (officeList.length<maxLocations) maxLocations = officeList.length;
    for(var count:int = 0; officeList!=null && count < maxLocations; count++) {
    // 6 on a page
    pdf.setFontSize ( 10 );
    if (count==0 || count%6==0) {
    pdf.addPage(page);
    y_position = 20;
    x_position = 20;
    pdf.addText(this.findModel.resultNumber + " " + resourceManager.getString('FindAnOffice','locationsFound'), x_position, y_position);
    y_position = y_position + 12;

    }
    x_position = referenceX;

    pdf.addText(resourceManager.getString('FindAnOffice','physicalAddress'), x_position, y_position);
    pdf.addText(resourceManager.getString('FindAnOffice','programsServed'), x_position + 90, y_position);
    pdf.setFontSize ( 8 );

    y_position = y_position+4

    pdf.addText(officeList[count].physicalAddress, x_position,y_position);
    y_position = y_position+4;

    pdf.addText(resourceManager.getString('FindAnOffice','phone') + " " + officeList[count].phoneNumber, x_position,y_position);
    y_position = y_position+4;
    pdf.addText(resourceManager.getString('FindAnOffice','fax') + " " + officeList[count].faxNumber, x_position,y_position);
    y_position = y_position+4;
    pdf.addText(resourceManager.getString('FindAnOffice','tdd') + " " + officeList[count].tddNumber, x_position,y_position);
    y_position = y_position+4;
    pdf.addText(resourceManager.getString('FindAnOffice','county') + " " + officeList[count].county, x_position,y_position);
    y_position = y_position+4;
    pdf.addText(resourceManager.getString('FindAnOffice','mailingAddress'), x_position, y_position);
    y_position = y_position+4;
    if (officeList[count].physicalAddress==officeList[count].mailingAddress) {
    pdf.addText(resourceManager.getString('FindAnOffice','sameAsPhysicalAddress'), x_position,y_position);
    } else {
    pdf.addText(officeList[count].mailingAddress, x_position,y_position);
    }
    y_position = y_position+4;

    lastY_position = y_position;

    y_position = y_position – 24;
    x_position = x_position + 90;

    var prg:Array = this.officeList[count].programs;

    for(var count_programs:int = 0; prg!=null && count_programs < prg.length; count_programs++) {
    var program:String = prg[count_programs];
    if(SSPConstants.SNAP_FOOD_PROGRAM_DESC==program){
    program=resourceManager.getString('FindAnOffice','snapPgm'); // doing this to get locale
    }else if(SSPConstants.MEDICAID_FAMILIES_PROGRAM_DESC==prg[count_programs]){
    program=resourceManager.getString('FindAnOffice','maPgm'); // doing this to get locale
    }else if(SSPConstants.TANF_CASH_PROGRAM_DESC==prg[count_programs]){
    program=resourceManager.getString('FindAnOffice','tanfPgm'); // doing this to get locale
    }else if(SSPConstants.MEDICARE_SAVINGS_PROGRAM_DESC==prg[count_programs]){
    program=resourceManager.getString('FindAnOffice','mspPgm'); // doing this to get locale
    }else if(SSPConstants.LONGTERM_CARE_PROGRAM_DESC==prg[count_programs]){
    program=resourceManager.getString('FindAnOffice','ltcrPgm'); // doing this to get locale
    }else if(SSPConstants.WOMEN_HEALTH_PROGRAM_DESC==prg[count_programs]){
    program=resourceManager.getString('FindAnOffice','whpPgm'); // doing this to get locale
    }
    pdf.addText(program, x_position,y_position);

    y_position = y_position+4;
    }

    if (y_position 10) {
    // var file:FileReference = new FileReference();
    // file.save(pdf.save(Method.LOCAL), “locations.pdf”);
    // } else {
    pdf.save(Method.REMOTE, SERVLET_MAPPING_URL, Download.INLINE, “locations.pdf”);

    // }

    Posted 23 Nov 2010 at 9:54 pm

Post a Comment

Your email is never published nor shared. Required fields are marked *