Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9297035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:58:11+00:00 2026-06-18T21:58:11+00:00

I’m attempting to create a pdf table on my flex application using AlivePdf: <?xml

  • 0

I’m attempting to create a pdf table on my flex application using AlivePdf:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                xmlns:mh="mh.components.*"
                layout="absolute" width="500" height="500">



<mx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;

        import org.alivepdf.colors.RGBColor;
        import org.alivepdf.display.Display;
        import org.alivepdf.drawing.Caps;
        import org.alivepdf.fonts.FontFamily;
        import org.alivepdf.fonts.Style;
        import org.alivepdf.grid.Grid;
        import org.alivepdf.images.ImageFormat;
        import org.alivepdf.layout.Orientation;
        import org.alivepdf.layout.Resize;
        import org.alivepdf.layout.Size;
        import org.alivepdf.layout.Unit;
        import org.alivepdf.pages.Page;
        import org.alivepdf.pdf.PDF;
        import org.alivepdf.saving.Method;
        import org.alivepdf.visibility.Visibility;

        import org.alivepdf.grid.*;





        private var myPDF:PDF;


        //print chart in pdf format
        protected function savePDF(e:MouseEvent):void
        {
            var myPDF:PDF = new PDF ( Orientation.PORTRAIT, Unit.MM);
            myPDF.setDisplayMode(Display.FULL_PAGE);
            myPDF.addPage();



            myPDF.setXY( 10, 70);
            myPDF.textStyle ( new RGBColor ( 0x000000 ) );

            var dp:ArrayCollection = new ArrayCollection();
            dp.addItem( { firstName : "Bob Geldorf akjaskaj skajs as kajs kaj k dklfj sdkfjl sdkjf ksdj fkjs dkfj ksdj ", lastName : "Groove", city : "Paris" } );
            dp.addItem( { firstName : "Bob", lastName : "Wise", city : "Paris" } );
            dp.addItem( { firstName : "Bob", lastName : "Wise", city : "Paris" } );
            dp.addItem( { firstName : "Bob", lastName : "Wise", city : "Paris" } );


            var grid:Grid = new Grid ( dp.toArray(), 200, 100, new RGBColor (0x00DEFF));


            myPDF.addGrid( grid, 0, 0, true );
            myPDF.save( Method.REMOTE, "coldfusion/pdf.cfm", "inline", "test.pdf" );;
        }



    ]]>
</mx:Script>    

<mx:VBox width="100%" height="100%">


    <mx:HBox width="100%" backgroundColor="#FFFFFF">
        <mx:Spacer width="100%"/>

        <mx:Button horizontalCenter="0" label="Save to PDF" height="22"  click="savePDF(event)"  id="savePDFBtn" toolTip="SAVE TO PDF"/>

    </mx:HBox>
</mx:VBox>

The strange thing is that the script create a table with double header and I don’t know why. You can see the pdf generated at this link: https://docs.google.com/viewer?url=prestitiinpdap.biz/pdf/myPDF.pdf

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T21:58:12+00:00Added an answer on June 18, 2026 at 9:58 pm

    Which version of the library do you use? I have tried to compile your code with the current version 0.1.5RC and the compiler could not find some classes.

    After correction of the class paths I have found that the “new Grid(…)” constructor needs 7 parameters (in your case only 4).

    Another issue is “width” in “Grid(…)”. I don’t know, what the developers wanted to express with it. I could get I normal view only with 60.

    I have got the following PDF after all:

    AlivePDF Grid

    Here is my code:

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" width="500" height="500">
    <fx:Script>
        <![CDATA[
        import mx.collections.ArrayCollection;
        import org.alivepdf.colors.RGBColor;
        import org.alivepdf.data.Grid;
        import org.alivepdf.display.Display;
        import org.alivepdf.drawing.Caps;
        import org.alivepdf.fonts.FontFamily;
        import org.alivepdf.fonts.Style;
        import org.alivepdf.images.ImageFormat;
        import org.alivepdf.layout.Orientation;
        import org.alivepdf.layout.Resize;
        import org.alivepdf.layout.Size;
        import org.alivepdf.layout.Unit;
        import org.alivepdf.pages.Page;
        import org.alivepdf.pdf.PDF;
        import org.alivepdf.saving.Method;
        import org.alivepdf.visibility.Visibility;
        import org.alivepdf.layout.*;
        private var myPDF:PDF;
    
        protected function savePDF(e:MouseEvent):void
        {
            var myPDF:PDF = new PDF( Orientation.PORTRAIT, Unit.MM); 
            myPDF.setDisplayMode( Display.FULL_PAGE, Layout.SINGLE_PAGE );
    
            var newPage:Page = new Page ( Orientation.PORTRAIT, Unit.MM);
            myPDF.addPage(newPage);
    
            myPDF.textStyle ( new RGBColor ( 0x000000 ) );
    
            var dp:ArrayCollection = new ArrayCollection();
            dp.addItem( { firstName : "Bob Geldorf akjaskaj skajs as kajs kaj k dklfj sdkfjl sdkjf ksdj fkjs dkfj ksdj ", lastName : "Groove", city : "Paris" } );
            dp.addItem( { firstName : "Bob", lastName : "Wise", city : "Paris" } );
            dp.addItem( { firstName : "Bob", lastName : "Wise", city : "Paris" } );
            dp.addItem( { firstName : "Bob", lastName : "Wise", city : "Paris" } );
    
            //var grid:Grid = new Grid ( dp.toArray(), 200, 100, new RGBColor (0x00DEFF));
    
            var grid:Grid = new Grid (dp.toArray(), 60, 100, new RGBColor(0x00DEFF), new RGBColor (0xFFFFFF), false, new RGBColor (0x000000));
            myPDF.addGrid( grid, 0, 0, true );
    
            //myPDF.save( Method.REMOTE, "coldfusion/pdf.cfm", "inline", "test.pdf" );
    
            var f:FileReference = new FileReference();
            var b:ByteArray = myPDF.save(Method.LOCAL);
            f.save(b, "test.pdf");
        }
    
        ]]>
    </fx:Script>    
    
    <mx:VBox width="100%" height="100%">
        <mx:HBox width="100%" backgroundColor="#FFFFFF">
            <mx:Spacer width="100%"/>
            <mx:Button horizontalCenter="0" label="Save to PDF" height="22"  click="savePDF(event)"  id="savePDFBtn" toolTip="SAVE TO PDF"/>
        </mx:HBox>
    </mx:VBox>
    </s:Application>
    

    Try it, may be it will help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm using an ASP request returning a XML file containing some latin characters. By
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am using JSon response to parse title,date content and thumbnail images and place
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.