Copy link to clipboard
Copied
I'm trying to generate a simple table with alivePDF. This is my code:
<?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.*;
import mx.utils.ObjectUtil;
private var myPDF:PDF;
protected function savePDF(e:MouseEvent):void
{
var myPDF:PDF = new PDF ( Orientation.PORTRAIT, Unit.MM);
myPDF.setDisplayMode(Display.FULL_PAGE);
myPDF.addPage();
var dp:ArrayCollection = new ArrayCollection();
dp.addItem( { firstName : "Bob", 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" } );
myPDF.textStyle ( new RGBColor ( 0x0EEFF0 ) );
trace(ObjectUtil.toString(dp));
var grid:Grid = new Grid ( dp.toArray(), 200, 100, new RGBColor (0x000000),null,false,null,null,0,12,6,"0j");
myPDF.addGrid( grid, 5, 5);
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="SavePDF" height="22" click="savePDF(event)" id="savePDFBtn" toolTip="SAVE TO PDF"/>
</mx:HBox>
</mx:VBox>
</mx:Application>
The problem is that this generate a double header and I don't know why. You can see a live example here: http://docs.google.com/viewer?url=http://prestitiinpdap.biz/pdf/myPDF.pdf
Could you help me solve this error?
Thanks
Copy link to clipboard
Copied
Maybe you will have better luck if you try presenting your problem at the AlivePDF site. They have their own forums and trouble report sections as well.
Copy link to clipboard
Copied
Many thanks, but the support seems discontinued also in the forum.
I got an answers on http://stackoverflow.com/questions/14799768/why-alivepdf-generate-double-table-header
Find more inspiration, events, and resources on the new Adobe Community
Explore Now