Giter Site home page Giter Site logo

Comments (11)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
I receive it as pure text.

Original comment by [email protected] on 17 Jun 2008 at 10:34

from alivepdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
[deleted comment]

from alivepdf.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 24, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.