Comments (9)
I think this is a bug. I after checking with FPDF source, I think line 2001 in
PDF.as should read:
} else this.x += pWidth;
instead of:
} else this.x += currentPage.w;
currently you are setting this.x to the page width which pushes any second cell
you try to add on the same line
off the page.
I hope that helps others. I am happy to post a fix if you want to give me SVN
access.
Thanks for all your hard work! - Kevin
Original comment by [email protected]
on 21 Jan 2008 at 9:27
from alivepdf.
[deleted comment]
from alivepdf.
Hi Kevin,
Nice one ! it's fixed now hehe !
I have to setup that SVN thing for sure and let you know :)
regards,
Thibault
Original comment by thibault.imbert
on 21 Jan 2008 at 11:24
from alivepdf.
If you need a quick easy cheap SVN host this is who I use:
myversioncontrol.com. I have a couple other fixes,
enhancements that I have found as I am working with the class. I will post
issues when I have a chance.
Original comment by [email protected]
on 21 Jan 2008 at 11:45
from alivepdf.
excellent, I will check that !
;)
Original comment by thibault.imbert
on 22 Jan 2008 at 1:59
from alivepdf.
thanks guys... i was really looking for this!
God bless!
Original comment by [email protected]
on 29 Jan 2008 at 5:23
from alivepdf.
This bug may have resurfaced.
I wasn't sure what the addCell() function was supposed to do. I was expecting
multiple addCell calls to layout horizontally, but they were displayed on the
next
line like in the original post here. I'm using version 0.1.4.5 that I
downloaded
yesterday (I'm linking in the SWC file with FlexBuilder 3). I'm glad to know
this is
a bug and not a feature.
-Brian
Original comment by [email protected]
on 5 Sep 2008 at 10:10
from alivepdf.
Hi everyone,
I am trying to add multiple cells to create a table using alivePDF 0.1.4.8
(which
should be the latest version) I am calling addCell in a for loop (as I pass a 2D
array holding the text for each cell and it's width to the constructor for my
"PDFTable" class)
But for some reason I can't get multiple cells to appear on one row (some rows
should
only have one cell and some have upto 4) If I have borders turned off, then it
will
draw the entire table (with only one cell per row), but if I have borders
turned on
as they will be in the final version, it will only create the first few rows of
the
table where there is only one cell per row? and the rest of the rows (with
multiple
cells on each) just dont display at all?
From reading the previous posts on this topic, a bug seems to have been fixed,
so am
I doing something wrong?
Here is part of my code (from my PDFTable class):
private function buildTable(){
var currRowHeight = 0;
var cellText:String = "";
var cellWidth:Number = 0;
var usedWidth = 0;
for(var row = 0; row < theData.length; row++){
currRowHeight = getRowHeight(theData[row]);
for(var col = 0; col < 99; col++){
trace("adding row "+(row+1)+" cell "+(col+1));
cellText = theData[row][col].Text || "";
cellWidth = theData[row][col].Width || tableWidth;
// Sets the width of the cell to make the table square
if(col == theData[row].length-1 || cellWidth > tableWidth){
for(var r = 0; r < theData[row].length-1; r++){
usedWidth+=theData[row].Width;
}
cellWidth = tableWidth-usedWidth;
}
pdf.addCell(cellWidth,20,cellText,options.CellBorder,row+1,"L",0,"");
if(theData[row][col+1] == null){
break;
}
}
}
}
Original comment by [email protected]
on 14 Apr 2009 at 4:10
from alivepdf.
I just tried it on v 0.1.4.9. It is not possible to create "tables" using
addCell or
AddMultiCell. Everything will show up in one column due to what I would think
is a
bug - the last line of code in addMultiCell sets the X coordinate to the left
margin
i.e currentX=lMargin; // line 2355 in PDF.as
To overcome this problem, you can set the X coordinate yourself and place the
columns
next to each other using the logic shown below.
var x:int = myPDF.getX();
var y:int = myPDF.getY();
myPDF.addMultiCell(50,10,"More text into a cell",1);
myPDF.setY(y);
x = x + 50; // 50 is the width of the last cell
myPDF.setX(x);
myPDF.addMultiCell(57,10,"Last text into a cell",1);
myPDF.setY(y);
x = x + 57;
myPDF.setX(x);
myPDF.addMultiCell(50,10,"Last text into a cell",1);
Note that if you interchange the order of setX and setY in the above code,
again
things may not work. Setting the Y coordinate usingthe setY method, resets the
X
coordinate to "lMargin". So you have to set Y and then set X to place you
columns at
the right locations...
Original comment by [email protected]
on 17 Jun 2009 at 9:44
from alivepdf.
Related Issues (20)
- ASDoc error
- writeHtmlText + addMulticell
- addBookmark supports only eight colors
- Can't override header or footer method HOT 1
- how can i open Local drive pdf file through AS3?
- Adding multiple image freeze the ui
- Grid problem
- addImage with displayObjects is not working
- AlivePDF does not print content of Flash Pro CS5.5 Stage
- AddImage() problem HOT 1
- Security error #3769 breaks navigateToUrl() while trying to save PDF HOT 5
- savePDF() method HOT 1
- problems with mx cavas scaled on add image
- Chinese characters won't show on iOS
- PNG error "Missing palette in current picture" HOT 1
- Some addGrid bugs HOT 1
- .. HOT 1
- setAutoPageBreak(true) does not restore margin HOT 1
- Problems exporting IPA with AIR SDK 15 & especially 16 in Flash Builder
- AlivePDF Page elements are messed up with AIR SDK 16+
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alivepdf.