0

How to add HTML content to Alive pdf page through 'writeFlashHTML' function?

 var markup:String = "<s:span>Z</s:span>
                      <s:span baselineShift="subscript">R</s:span>
                      <s:span>&#32;[kN]</s:span>";
 rt1.textFlow = TextFlowUtil.importFromString(markup);

 <s:RichText id="rt1" width="200"/>

in the code view

myPDF.setXY(160, 10);
myPDF.textStyle( new RGBColor(0), 1 );
myPDF.writeFlashHtmlText(10,rt1.textFlow.text);

I need to display this html in to alive pdf.using writeFlashHTML function.Currently it is not working.

Shebin
  • 3,310
  • 2
  • 24
  • 27
  • I know there is an .htmlText property for TextFields, try using that instead of .text – ToddBFisher Jan 05 '12 at 15:42
  • @ToddBFisher:I have used alive pdf library to generate pdf. It does not support greek character like alpha,Beta etc...How to add UTF8 characters in to pdf . – Shebin Jan 06 '12 at 04:45
  • go to http://alivepdf.bytearray.org/?p=440 and see how to embed a font. Did using htmlText work for you? – ToddBFisher Jan 06 '12 at 05:35
  • @ToddBFisher:Thanks for your reply.Html text is not working.For greek character which font we need to use and supported in alive pdf.I checked with alive pdf forum but did't get any luck. – Shebin Jan 06 '12 at 06:01

1 Answers1

0

There is UnicodePDF as a replacement to the PDF Class. Although it doesn't support writing of HTML.

I found the html stuff limited with alivepdf, or I just don't understand alivePDF well enough. So my work around was to use a flash component that supported the formatting options I was after, then cache that as a Bitmap and add that to the PDF. It's not as elegant as directly writing the text, doesn't scale or print as nicely, and is not selectable. But gets the job done. Ultimately I think it's best to send the info to another server side script, or desktop service, for this type of thing. AlivePDF rocks, but has limitations.

Lex
  • 4,749
  • 3
  • 45
  • 66