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

addGrid gets a repeatHeader parameter !

I have just uploaded in the SVN an updated version of AlivePDF ( which includes a repeatHeader parameter in the addGrid method :

public function addGrid ( grid:Grid, x:Number=0, y:Number=0, repeatHeader:Boolean=true ):void

This will allow you to repeat columns header on each page where the grid is flowing.

This was a request, hope you'll like it Willis ;)

Comments 58

  1. Dipingere wrote:

    The “repeatHeader” for columns is very useful.

    Thanks to Thibault as always.
    AlivePDF is most powerful everyday.

    Request: video tutorial for “Grid” to use “GridColumn” with dataProvider with removeColumn only in the PDF not in the MovieClip.

    Posted 23 Mar 2009 at 8:49 pm
  2. willis wrote:

    Thank you Thibault .
    I’m so glad you can implement my request to this.

    Posted 24 Mar 2009 at 7:10 am
  3. Dipingere wrote:

    Hello again:
    I have tried to implement the “addGrid” but I have not been successful, what should I do for it to work?

    I have achieved that the DataGrid component generates in the dataGrid with data in the generated PDF, but need to remove one of the columns with the datagrid data received through “mydataProvider.addItem ((Name: name, Last: last, …})”

    I tried:
    . removeItemAt (
    . RemoveItem (
    and many more
    but nothing…

    although the data come as “AddItem” did not take it as an array “var grid: Grid = new Grid (mydataprovider.toArray (),…”

    - Does not stay the order of the data.
    - Not maintaining the size of the columns.
    - Can not delete columns.

    and the size of the DataGrid is in pixels and comes out of the leaf

    Pixels could be implemented in “”?
    something like: public static const PX: String = “Px”;

    Thanks Thibault

    Posted 24 Mar 2009 at 9:14 am
  4. Gonçalo Fortes wrote:

    Sorry for posting this here, but I don’t know how to do this and have already tried everything.
    I want to generate a file that contains only one table using the addGrid method.
    I want to adjust the size of the file so that has exactly the size of the table.
    Have already tried lots of combinations of DisplayMode, Orientation and Size of the pdf class, but nothing.
    I was only able to do this using the addImage method…
    Can you please help me?

    Posted 24 Mar 2009 at 4:19 pm
  5. Noel wrote:

    Hi great work…is there a way to hide the border of the grid in the pdf ?

    Posted 25 Mar 2009 at 4:44 pm
  6. Teuf wrote:

    A minor thing to fix: the SVN tree has a duplicate directory ‘events’ and ‘’

    Posted 26 Mar 2009 at 2:29 am
  7. Thibault Imbert wrote:

    Hi Teuf,

    Thanks!, this should be fixed now ;)

    Posted 26 Mar 2009 at 2:36 am
  8. Connie wrote:

    Hello Thibault,

    Is there any way to get around adding PNG images with alpha channel ?

    I currently capture an image using ImageSnapshot with 300 dpi. However, it uses alpha channel by default, but I currently cannot add the data using addImageStream as it throws an Alpha Channel not supported exception.


    Posted 26 Mar 2009 at 2:40 am
  9. Thibault Imbert wrote:

    Hello Connie,

    Unfortunately, ImageSnapshot does not allow you to specify the final transparency of the image captured. I really have to add transparent PNG support in the next release of AlivePDF.

    For now, if you really need this, you can use a classic encoder like PNGEncoder or JPEGEncoder and pass to those encoding classes a non transparent BitmapData instance, this would work, but you would have to handle the dpi resizing manually.

    Posted 26 Mar 2009 at 2:48 am
  10. Dipingere wrote:

    Hello again Thibault:

    if I use “grid.columns = columns;” the PDF “Grid” just appears the columnheaders no data stored by the dataProvider,

    But if it is commented // grid.columns = columns;
    my dataGrid component appears in the PDF but the order of columns, dataGrid size and cell size not match.

    I want to remove one cell dataGrid just in generatedPDF, but the dataProvider provides all data in Ascending Order.

    I tried:
    “var columns:Array = […”

    but nothing happens.

    Thank you so much.

    Posted 26 Mar 2009 at 5:09 am
  11. willis wrote:

    Hi Thibault:
    I don’t know where I can report bugs, sorry for paste here.
    When I want print the footer with string like “Page 1 of 5″, the first number is current page number “nbPages” and the second is totalpages, but found the totalpages is not correct.
    After view the code, I find the setAliasNbPages(‘{nb}’) can resolve what I want.
    For example call the pdf.setAliasNbPages(‘{nb}’)
    then writetext at footer() with string ‘Page ‘+this.nbPages +” of {nb}”.
    The bug I find is at protected function createPageTree():void
    if( aliasNbPages != null )
    for( n = 0; n<nb; n++ ) arrayPages[n].content = findAndReplace ( aliasNbPages, ( nb as String ), arrayPages[n].content );
    I make change for these codes to be here:
    if( aliasNbPages != null )
    for( var j:int = 0; j<nb; j++ )arrayPages[j].content = findAndReplace ( aliasNbPages, ( “”+nb), arrayPages[j].content );
    And the bug is gone. Just paste these code change here for your information.

    Posted 31 Mar 2009 at 6:30 am
  12. gonfor wrote:

    I want to generate a file that contains only one table using the addGrid method.
    I want to adjust the dimensions of the file so that has exactly the dimensions of the table.
    Have already tried lots of combinations of DisplayMode, Orientation and Size of the pdf class, but nothing.
    I was only able to do this using the addImage method?
    Can someone please help me?

    Posted 31 Mar 2009 at 1:33 pm
  13. Alex wrote:

    Hey Thibault,

    I guess you have a mistake in file here:

    change timeBI to timesBI

    Good luck!

    Posted 03 Apr 2009 at 6:45 pm
  14. Thibault Imbert wrote:

    Hi Alex,

    Good bug ! Thanks a lot for tracking it :)



    Posted 03 Apr 2009 at 7:35 pm
  15. David wrote:

    Hi Thibault:

    I see various comments in this post about:

    “i can’t get row height to match my text in cell”,
    “all Columns have the same size”
    “all rows have the same size – variableRowHeight = “true” doesn’t work either”

    in myDataGrid.DataProvider.toArray()

    but if I use Grid and Array for “columns”
    “grid.columns = columns;” the PDF Grid it´s ok.

    but what happend if the user can populate myDataGrid and when it is populated at all, then they can generate PDF.

    what are we doing wrong?

    or what we can do?

    the “grid.columns” it´s not compatible with “myDataGrid.columns=…”
    or else “myDataGrid.addColumn(“…”)”

    If we want to remove one column in “Grid” it´s possible,
    but in myDataGrid it´s not.

    Anyone have an idea about that?

    Thanks for all and kind regards.

    Posted 04 Apr 2009 at 10:50 pm
  16. Alex wrote:

    BTW, Thibault, is there any way to set vertical padding in Cell/Multicell? In my situation cell is filled and should be with specific margins

    as I understand cMargin is only horizontal-padding of cell.

    Now I see only one way – add an empty cell with same color and height = vericalPadding before and after my cell/multiCell…

    maybe I’m trying too hard and should take a break? :D

    Posted 06 Apr 2009 at 5:13 pm
  17. Tejas Sanghavi wrote:

    Hi Thibault,

    Can we have the functionality to center align a grid or at least have it aligned by certain pixels from the left.


    Posted 07 Apr 2009 at 9:58 pm
  18. David wrote:

    Hi Thibault:

    You said something about “adding a Microsoft Excel feature”

    How to control order in “Grid.columns, or what happen if the data is provided by “array.addItems[{..."?.

    I tried that but get the data sorted by the "AS3 array" and I could not rearrange the data with the method "Grid.columns" because the new "array" no reorders and maintain the same order, and size of columns can not eliminated any column, because "datagrid.dataprovider" are taken as a single item to fill all the fields in each cell as [Object, object], where there are several columns in this “array”

    And if I try “Push” then creates several rows.

    Any idea?
    Thanks again.

    Posted 07 Apr 2009 at 11:30 pm
  19. David wrote:

    add to the last comment:

    the “AlivePDF Grid” is taken the data as is but in Ascendent order

    but in AS3 trace(myArray); the panel shows [Object, object].

    It take it like 1 item not like 5 columns.

    Posted 07 Apr 2009 at 11:39 pm
  20. Emad wrote:

    Is there any way to add a grid with column contains images to PDF object?
    I have tried to do that but I got the following message in the catch block around the “addGrid” function:
    “TypeError: Error #1009″
    what should I do?

    Posted 14 Apr 2009 at 11:02 am
  21. Emad wrote:

    I’m using the latest version of the AlivePdf (AlivePDF but I’m not able to use the repeatedHeader parameter. I browsed the source code of the API and verified that the fourth parameter (repeatedHeader) doesn’t exist, so I need to get the latest code from the repository and build it to get SWC file and use it.
    How could I do that?

    Posted 14 Apr 2009 at 1:03 pm
  22. Ana wrote:


    I´m using the latest version of the svn. But since the addition of the repeatHeader parameter I have had problems with the color of the name columns. When I create the grid it seems that headerColor is both used as the color fill of the column`s name and the color of the letter, so it can´t be read in spite of the word really exists.

    Something similar has happened to someone?


    Posted 14 Apr 2009 at 3:35 pm
  23. Andrea wrote:

    hi, i don’t know what should i do to get the latest alivepdf svn to be able to use the repeatHeader property, could anybody teach me what to do?


    Posted 14 Apr 2009 at 11:01 pm
  24. Dipingere wrote:


    Can you post the “.fla”?

    Any tutorial of AlivePDFgrid?

    The columns size and order mismatch between AS3 Datagrid and AlivePDF Grid, Have you any idea about that?

    there are various comments about it in this post but no one response.

    I think the repeatheader parameter functions just for AlivePDF Grid.dataProvider New Array not for AS3 Datagrid.dataProvider Array

    Posted 16 Apr 2009 at 10:12 pm
  25. Emad wrote:

    Ana, You have to download some SVN client, lets say: tortoiseSVN ( and just pull the repository to your computer.
    then instead of adding the SWC file to the build path, just copy the alivePDF code you have pull to your working directory.

    Posted 20 Apr 2009 at 10:06 am
  26. Emad wrote:

    To get any order you want for the pdf grid, you have to create an array of GridColumn, and give it to the “Grid.columns” then the order will be as you arrange the elements inside the array. Have a look at this code snippets:
    var col1:GridColumn= new GridColumn(“column1″,”col1″,20,”L”,”L”);
    var col2:GridColumn= new GridColumn(“column2″,”col2″,25,”L”,”L”);
    var columns:Array= new Array(col1, col2);
    myGrid.columns= columns;
    this will give a grid has col1 as the first column and col2 as the second one.
    if you do this:
    var columns:Array= new Array(col2, col1);
    myGrid.columns= columns;
    then you will have col2 the first, and col1 the second

    Posted 20 Apr 2009 at 10:17 am
  27. Ana wrote:

    Hello again, and thank you for your anwser, but I´m afraid itsn´t my case.

    I download the last version through subversion tortoise with the path and I compile the proyect to generate the library (AlivePDF.swc).

    After this I add the swc file to the library folder of my current proyect.

    I´ll try to follow your advise and introduce the folder structure (org.alive.*) directly into my proyect.

    Posted 20 Apr 2009 at 1:01 pm
  28. Lars wrote:

    Hi, I think I have discovered a bug in the Alive PDF grid implementation.

    I don’t want to have any lines in the table in my PDF so I have set the line style of my pdf document to draw white lines. This works fine for the first page of my grid but as soon as the grid overflows the first page and a new page is automatically added, the lines on the new page are drawn in black.

    Thank you for a brilliant library.

    Posted 20 Apr 2009 at 1:07 pm
  29. Ana wrote:


    is time I want to comment that I have problems with the column width and the add pages.

    For example, when the length of the sentence is longer than the width of the column, automatically it´s split the sentence and put the second part below . This is correct, but not when the document have more than one page.
    When it is necessary to add the second page, the last row of the first page it isn´t correctly processed, because it is split and a blank page is added too.

    Thanks and regards

    Posted 20 Apr 2009 at 1:14 pm
  30. Dipingere wrote:


    First of All, thank you so much for answer me.

    I tried this, but, If I arrange the elements inside the GridColumn Array, then no longer reads any data of AS3 dataGrid.dataProvider, else reads data that is added to Grid.columns Array.

    what do you think about that?

    kind regards

    Posted 23 Apr 2009 at 6:49 am
  31. Dipingere wrote:


    If I use “GridColumns” and AS3 dataGrid.dataProvider, almost everything appears ok but no one type or “data” appears in the “AlivePDF Grid” it is as the type were blank.

    the rows order: “Col2″, “Col1″, “Col3″ it´s ok
    the rows size: “15″, “25″, “40″ it´s ok
    the rows Number: (my dataprovider has 10 rows and 10 rows appears in generated AlivePDF) it´s ok

    but none appears typography inside of the rows Grid.

    The AlivePDF Grid is catching dataProvider but the rows
    appears in blank.

    it´s like the typography was white, but it´s not.

    but if I don´t use gridcolums, the typography and dataGrid in generated AlvePDF is there and it´s Black. the header is ok but the size, order and number of columns don´t match.


    Posted 23 Apr 2009 at 7:49 am
  32. Emad wrote:

    Ok Dipingere, the following code is a simple prototype for using AlivePDF data grid with the flext one, it saves the grid in the current columns order each time you change the order.
    Sorry for the dirty code, it was just a prototype for my own testing. try to figure it out, if couldn’t I’ll tidy it somehow :-) . So, here it is:



    Posted 23 Apr 2009 at 9:42 am
  33. Emad wrote:

    Ops! it didn’t appear :-( . tell me how I could send you the code, or if I could attach the code in this page somehow

    Posted 23 Apr 2009 at 9:45 am
  34. Dipingere wrote:


    via mail: – dipingere – @ – hotmail -

    I put it separating via dash. You Know…

    thank you so much…

    Posted 24 Apr 2009 at 2:06 am
  35. balajee.k wrote:

    Hey Thibault,
    When I create grid using addGrid , fewrows data overlapping because of more char in a particular cell data.
    1. Create a datagrid with some data,(make one cell data more than 50 char)
    and make the datagrid variable rowheight and set wordwrap true for the
    larg cell. create pdf using addGrid method. few rows data overlapping for the
    large cell
    3. I attached sample pdf file

    I am using AlivePDF_0.1.4.8 on windows XP


    Posted 24 Apr 2009 at 11:11 am
  36. Dipingere wrote:


    I found that the problem was that “AS3 DataGrid” takes the data as the dataProvider: datacolumn1 and “AlivePDF Grid” takes the data from DataGrid.dataProvider, not direct from DataProvider.

    Then the header name is col1 and I was passing the data as (” col1 “,” datacolumn1 “,” L “,” L “) and what I did was put (” col1 “,” col1 “,” L “,” L “);


    Now my question is:

    1. IMAGE:
    How can I insert a picture to “AlivePDF generated”

    I tried this:

    myPDF.addImage ();

    myPDF.addImage (image, .5 , Blend.NORMAL, null, false, ImageFormat.JPG, 100, 160, 110, 0, 0);

    but I don´t know how AlivePDF takes the image from.

    The Thibault´s function is:

    public function addGrid ( grid:Grid, x:Number=0, y:Number=0, repeatHeader:Boolean=true ):void

    And I just use:


    How to use this function?
    Because in page 2 the header is not repeating, just extends the grid without the header.

    the type function is ok i use:
    myPDF.setFont(FontFamily.ARIAL, Style.NORMAL, 7);
    myPDF.addMultiCell(200, 4, “some text to check…”);

    my imports are:
    // AlivePDF
    import org.alivepdf.pdf.PDF;
    import org.alivepdf.layout.Orientation;
    import org.alivepdf.layout.Size;
    import org.alivepdf.layout.Unit;
    import org.alivepdf.layout.Align;
    import org.alivepdf.display.Display;
    import org.alivepdf.saving.Method;
    import org.alivepdf.fonts.FontFamily;
    import org.alivepdf.fonts.Style;
    import org.alivepdf.colors.RGBColor;
    import org.alivepdf.drawing.Joint;
    import org.alivepdf.drawing.Blend;
    import org.alivepdf.images.ImageFormat;
    // END AlivePDF

    maybe I missing some imports from org.alivepdf

    or any idea?

    thank U

    Posted 25 Apr 2009 at 12:44 am
  37. Dipingere wrote:

    Thibault and Emad:

    searching… AlivePDF ( which includes a repeatHeader parameter

    I do update the and and files but an error appears:

    ReferenceError: Error #1065: the variable FontType is not defined.
    at org.alivepdf.pdf::PDF/setFont()
    at MethodInfo-586()

    Do you know what is happend?

    or what I do to use repeatheader?

    Posted 25 Apr 2009 at 1:55 am
  38. Dipingere wrote:

    another missing file “”
    but… another error found:

    An unrecognized token ´NaN´ was found

    What´s this?

    Posted 25 Apr 2009 at 5:01 am
  39. kelvin.zhao wrote:

    Hi Thibault:

    How can i add the page number to the pdf file.

    Like page 1, page 2…

    Posted 29 Apr 2009 at 8:01 am
  40. Clive wrote:

    Hi Thibault

    Thanks again for this awesome PDF generation script.

    I have found that when using “addGrid”, it ONLY works perfectly when NOTHING is declared before the “grid”. If you use “addImage” or “writeText” before calling “addGrid”, the generated grid intermittently CUTS the last row in half (only the first half of the columns show, the other half of the columns show on the next page) . This bug breaks the grid format as it looks ugly. In conclusion, “addGrid” only works well for a one page PDF, not multi pages.

    Hoping this would be fixed sometime soon.


    Posted 04 May 2009 at 5:23 pm
  41. Clive wrote:

    Hi Thibault,

    I’ve fixed the above by doing the following:

    In, LINE 2992, change “checkPageBreak(5);” to “checkPageBreak(10);”

    This effectively makes the check stricter and avoids “chopping” of columns in a row.

    Perhaps you want to add to your next release.


    Posted 04 May 2009 at 5:53 pm
  42. Thibault Imbert wrote:

    Hi Clive,

    It seems like you are using an old revision of the release. Can you download the latest version from the SVN or here :

    I just have updated the package over there, I modified a few weeks ago the whole mechanism for the dynamic grid. It should work smoothly with no tuning :)

    Let me know :)


    Posted 04 May 2009 at 6:16 pm
  43. Clive wrote:

    Thanks Thibault. It works – PERFECTLY!
    Thank you and thank you! There’s no donate on your site – otherwise I would buy you a beer!

    Posted 05 May 2009 at 11:11 am
  44. Thibault Imbert wrote:

    Hi Clive,

    Count one me, I will remember that, a beer ! :)

    I am happy it works smoothly !

    Posted 05 May 2009 at 10:42 pm
  45. veera wrote:

    while displaying in pdf, grid header text is not ordered it takes default alphapatical order.. hw can i overcome this?? am using latest alivepdf o.1.4.8. and also empty grid column is not displayed in pdf


    Posted 06 May 2009 at 3:50 pm
  46. Ana wrote:

    Hello all,

    I can´t print the legend of a chart like and image to the pdf file.It doesn´t appear.
    It is not too strange??


    Posted 19 May 2009 at 4:14 pm
  47. Ana wrote:

    Hello again,

    I have found the question of my problem. If I put the legend before the chart in the mxml code, it appears.

    So I think the problem is when the chart is processed, because I have a button placed below the chart and it doesn´t appear neither.

    I hope this can helps.


    Posted 20 May 2009 at 1:46 pm
  48. DELL wrote:

    Couldn’t we get alpha feature in beginFill method?

    Posted 21 May 2009 at 4:35 pm
  49. djo wrote:

    Hello Thibault,

    Pour commencer, un grand bravo pour cette librairie ! vraiment utile et très bien conçu !

    Ensuite, je suis en train de faire un petit programme en AIR, et je n’arrive pas à mettre une entête et un pied de page dans un PDF….

    Pour l’instant j’ai simplement mis du texte, mais je dois le remettre à chaque page.. un peu embêtant

    Aussi, j’aimerais faire une petite bordure en bas de l’entête et au dessus du pied de page !

    Salutations !

    Posted 10 Jun 2009 at 12:24 pm
  50. Uli wrote:

    Hi Thibault,

    first of all: Thanks for this great plugin…

    But I´ve got a little problem: I cannot find the Grid / addgrid (or whatever) in the documentation…

    Is it my fault or isn´t the documentation up to date?!

    Thanks a lot


    Posted 16 Jun 2009 at 7:55 am
  51. Umarfarook84 wrote:

    Hi Thaibult,

    When i am trying to add Grid with multi columns say 15 columns which exceeds the page width .. the last few columns are missing. Shouldn’t the missing columns come in the next page. (Just like in excel).

    My code :
    var grid:Grid=new Grid(columnData.toArray(), 200, 150, new RGBColor(0×666666), new RGBColor(0xCCCCCC), new RGBColor(0), true, new RGBColor(0×0), 1, Joint.MITER);

    Let me know if i am going wrong somewhere.


    Posted 02 Jul 2009 at 8:10 am
  52. Umarfarook84 wrote:

    Hi Thaiabult,

    When we are trying to add an Image to the grid, the images are not coming in the PDF instead it takes the object name and prints.
    Can we add images to the grid column if so
    achieve this. It is little urgent.


    Posted 02 Jul 2009 at 8:13 am
  53. UmarFarook84 wrote:

    I tried to overcome this above issue by extending the PDF class and overriding the
    addMulticell method.
    The addMulticell method currently takes a string object alone. If this method is
    generalized to get all objects including the image or bytearray the above issue will
    be resolved.

    currently i am overriding the addMulticell to achieve the above functionality.
    Below is the sample code.

    override public function addMultiCell ( width:Number, height:Number, text:String,
    border:*=0, align:String=’J', filled:int=0):void
    cw =;
    var imageType:String=”";

    (Application.application.bytes,currentX,currentY,0, 0, 1);

    if ( width==0 ) width = currentPage.w-rMargin – currentX;

    var wmax:Number = (width-2*cMargin)*1000/fontSize;
    var s:String = findAndReplace (“\r”,”,text);
    var nb:int = s.length;

    if( nb > 0 && s.charAt(nb-1) == “\n” ) nb–;

    var b:* = 0;

    if( border )
    if( border == 1 )
    if(border.indexOf(‘L’)!= -1) b2+=’L';
    if(border.indexOf(‘R’)!= -1) b2+=’R';
    b = (border.indexOf(‘T’)!= -1) ? b2+’T’ : b2;

    var sep:int = -1;
    var i:int = 0;
    var j:int = 0;
    var l:int = 0;
    var ns:int = 0;
    var nl:int = 1;
    var c:String;

    var cwAux:int = 0;

    while (i0)
    write(’0 Tw’);

    if(border && nl==2) b=b2;

    if(c==’ ‘)
    var ls:int = l;

    // TBO
    cwAux = cw[c] as int;
    if (cwAux == 0) cwAux = 580;
    l += cwAux;

    if (l>wmax)
    if(i==j) i++;
    write(’0 Tw’);
    ws=(ns>1) ? (wmax-ls)/1000*fontSize/(ns-1) : 0;
    write(sprintf(‘%.3f Tw’,ws*k));


    if ( border && nl == 2 ) b = b2;
    else i++;
    //Last chunk
    write(’0 Tw’);

    if ( border && border.indexOf (‘B’)!= -1 ) b += ‘B’;
    addCell ( width,height,s.substr(j,i-j),b,2,align,filled );
    currentX = lMargin;

    Posted 06 Jul 2009 at 5:40 pm
  54. iamhepp wrote:

    I can’t begin to tell you what a god-sent AlivePDF is for me, however I am having a problem and can’t seem to find a way to resolve it.

    I am taking a Flex DataGrid used to produce a product quote based on the user’s selections of various option for that product and printing out a pdf.

    In DataGrid I format each cell in the Description column to display all the various options selected for each product to be purchased.

    Product XYZ
    – add 234
    – add qrx
    – add 2b or knot 2b

    In Actionscript I format the text for the DataGrid with carriage returns and tabs using:

    but it won’t translate into the PDF. What can I do to format the text properly in the text before I send it to the AlivePDF Grid?

    ************* ACTIONSCRIPT PARSING *************
    descript = product;

    // Add Description of Each Option Added
    descript = descript + “\r\t” + addProduct.description;

    for each ( var option:Object in addProduct.selectedOptions ){
    var code:Array = String(option.Code).split(”-”);
    descript = descript + “\r\t\t” + “- ” + code[1] + “: ” + option.Title;
    // Add To Quote ArrayCollection
    cartDP.addItem({item:item, unit:unit, qty:qty, part:part,
    descrpt:descript , uPrice:uprice, tPrice:tprice});

    public function generatePDF ( ):void {
    var newPDF:PDF = new PDF( Orientation.PORTRAIT, Unit.MM, Size.LETTER );
    newPDF.addEventListener( PageEvent.ADDED, pageAdded );
    newPDF.addEventListener( ProcessingEvent.STARTED, generationStarted );
    newPDF.addEventListener( ProcessingEvent.PAGE_TREE, pageTreeGeneration );
    newPDF.addEventListener( ProcessingEvent.RESOURCES, resourcesEmbedding );
    newPDF.addEventListener( ProcessingEvent.COMPLETE, generationComplete );
    // NEW PAGE
    // STYLES
    newPDF.setFont(FontFamily.ARIAL , Style.NORMAL, 9)
    newPDF.textStyle(new RGBColor (0×000000) );
    var gcItem:GridColumn = new GridColumn(”ITEM”, “item”, 10, Align.CENTER, Align.CENTER);
    var gcQtny:GridColumn = new GridColumn(”QTY”, “qty”, 10, Align.CENTER, Align.CENTER);
    var gcUnit:GridColumn = new GridColumn(”UNITS”, “unit”, 15, Align.CENTER, Align.CENTER);
    var gcPart:GridColumn = new GridColumn(”PART NUM”, “part”, 25, Align.CENTER, Align.CENTER);
    var gcDesc:GridColumn = new GridColumn(”DESCRIPTION”, “descrpt”, 90, Align.CENTER, Align.JUSTIFIED);
    var gcUPrice:GridColumn = new GridColumn(”UNITS $”, “uPrice”, 15, Align.CENTER, Align.RIGHT);
    var gcTPrice:GridColumn = new GridColumn(”TOTAL $”, “tPrice”, 15, Align.CENTER, Align.RIGHT);
    // Column Array
    var columns:Array = new Array(gcItem, gcQtny, gcUnit, gcPart, gcDesc, gcUPrice, gcTPrice);

    var myGrid:Grid = new Grid( shpCrtDG.dataProvider.toArray(),
    new RGBColor (0xCCCCCC),
    new RGBColor (0xE2E2E2),
    new RGBColor (0),
    new RGBColor ( 0×0 ),
    Joint.ROUND );
    myGrid.columns = columns;
    newPDF.addGrid( myGrid, 10, 10, true);

    // SAVE PDF
    var path:String = “pdfQuotes/” + pdfName.text + “.pdf”;
    var file:File = File.applicationStorageDirectory.resolvePath(path);
    savePDF(newPDF, file);
    } // END generatePDF()

    Any ideas would be appreciated.


    Posted 13 Aug 2009 at 7:21 pm
  55. Nathan wrote:

    Hey Thibault,
    Could you post an example code of a DataGrid being added to a PDF with multi-page content being added so that it spans more than one page?

    Posted 06 Nov 2009 at 1:19 am
  56. Vimal wrote:

    Grat work. I’m using this library to print DataGrid/Charts etc into PDF. How do I print a Tree Grid in PDF. ie the same datagrid wit HierarchicalCollection.
    getting the following error
    : Error #1069: Property toArray not found on mx.collections.HierarchicalCollectionView and there is no default value.


    Posted 13 Nov 2009 at 10:02 pm
  57. Mark Wisniewski wrote:

    First off great work with this its truly a great ting.

    In my document I have an image and some text before adding the grid. so the y value of the grid is 72. and I have the repeatheader set to true. When I have spill over rows of data to be displayed on a second page it also sets the grid on the new page to a y value of 72. So I have 72 mm of white space at the top of the second page.

    My question is this… Is there a way to set the new page to display the grid at a y value of 0 to eliminate the white space?


    Posted 05 Oct 2010 at 9:25 pm
  58. owenm wrote:


    I’m trying to add a grid to a PDF, but when I open the PDF, every cell is very short. Hunting around, I found in > getRect(), there is a variable called ‘ph’ that is set to 5. This function calculates the number of lines based on a string passed in to another function called nbLines(), then multiplies it by this ‘ph’ variable.

    If I change ‘ph’ to 15, the cell height changes appropriately, but then the text for the cell is stuck overlapping the top edge of the cell! This seems to be governed in the addCell() function in the same file, by passing a complex formula into a sprintf() function. I tried modifying this formula, but it made lining things up even worse…

    So, I guess the basic question is, how to I get the cell heights to adjust properly with the text staying within the cell’s boundaries?

    Posted 28 Jun 2011 at 11:06 pm

Post a Comment

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