Comments (11)
Hi,
AlivePDF recognizes \n instead of /n.
If you really want to use /n, you can use a little regexp to replace each /n
with a \n.
let me know ;)
kind regards,
Thibault
Original comment by thibault.imbert
on 17 Jun 2008 at 12:40
from alivepdf.
Hi,
That was a typo...I am using \n. Currently I store text in an Oracle database
and
read it in using Flex's RPC. When it's read in from the database, ALIVEPDF
does not
recognize \n. Though, if I hard code text in the writeText() method it works.
Thanks for your help.
Original comment by [email protected]
on 17 Jun 2008 at 6:33
from alivepdf.
Humm interesting, do you receive the data as XML data ? pure text ? AMF packets
?
let me know ;)
Thibault
Original comment by thibault.imbert
on 17 Jun 2008 at 6:51
from alivepdf.
I receive it as pure text.
Original comment by [email protected]
on 17 Jun 2008 at 10:34
from alivepdf.
Hello.
I receive the data as XML and have the same problem...
Any changes on this?
Thanks in advance,
Jácome
Original comment by [email protected]
on 4 Dec 2009 at 1:48
from alivepdf.
Hi,
I have the same problem...
Hard coding works fine, but when dynamic data is used it falls over.
Is there any fix for this problems?
Original comment by [email protected]
on 16 Mar 2010 at 3:59
from alivepdf.
any solution to the problem with dynamic text from database, please communicate
Original comment by [email protected]
on 29 Apr 2010 at 9:48
from alivepdf.
Im not that good at programing as a whole.. how do i use regular expressions to
find and replace "/n"?
i found alot of info on regex in general but not for finding and replacing non
print chars
Original comment by [email protected]
on 15 Dec 2010 at 2:29
from alivepdf.
[deleted comment]
from alivepdf.
I had the same problem writing to a SQL Server database from a Flash multiline
textbox and then trying to use the writeText() function in AlivePDF. The answer
is simple once you realise what is going on with the data. Flash sends a new
line to the database as an ascii char(13) character, which is a carriage
return. AlivePDF is looking for a char(13) + char(10) (carriage return +
linefeed). So to fix this problem you'll have to add a function in your
actionscript file to convert the flash char(13) to either a char(13) + char(10)
or just use the "\n". I've pasted in the function that I use:
private function convertString(_value:String):String
{
var returnString:String = "";
var _chr:String = String.fromCharCode(13);
var tempArray:Array = _value.split(_chr);
for(var i:uint = 0; i < tempArray.length; i++)
{
returnString += tempArray[i] + "\n";
}
return returnString;
}
Then just call this function from your main program:
myPdf.writeText(2, convertString(textFromDatabase);
John
Original comment by [email protected]
on 16 Jan 2011 at 6:51
from alivepdf.
Brilliant John! Thanks for that! I was goofing around for quite a while
replacing different characters without getting it right. How did you figure out
what was saved in the database and what alive pdf was expecting? Loop over the
string and somehow printing the ascii representation of each character?
Here is another version of your convertString function, using a regular
expression rather than splitting the string and looping the array.
private function convertString(value:String):String
{
return value.replace(/\r/g, "\n"));
}
Lars
Original comment by [email protected]
on 5 Jun 2011 at 9:50
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.