apache-flexalivepdf

AlivePDF, can't set font


I have AlivePDF with Flex, making a webapp. I've got version 1.5 of AlivePDF but can't seem to set the font:

myPDF.setFont( FontFamily.ARIAL, Style.BOLD );

this gives an error of "1067: Implicit coercion of a value of type String to an unrelated type int."

Am I doing it wrong?


Solution

  • Most likely you're trying to set a int value where you should be using a String.

    If you review the AlivePDF ASDocs for the setFont method, you'll see that it takes three arguments, an instance of IFont, the size as an int, and a Boolean that tells whether or not the font is underlined.

    You are trying to set the font size (which should be an int) with a string value (Style.BOLD )