Text Justification

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for COM/ActiveX (v6)  /  Re: Text Justification

DynamicPDF CoreSuite for COM/ActiveX (v6) Forum

 Feb 15 2011 11:00 AM
Is it possible to justify (full) a label based upon the text (font & font size) and width provided? It appears that left, center, and right are the only available options to the label's align property.
 Feb 15 2011 12:13 PM
Posted by a ceTe Software moderator
Yes, you can justify the text which you are adding without any problem using our DynamicPDF Generator product. You will have to use DPDF_TextAlign_FullJustify enumerator using which you can make the text to align to Justify, FullJustify,Center, Left and Right. Below is the sample code for it.

<!-- METADATA TYPE="typelib" UUID="{DF9225FE-94A4-490D-8CAD-E8366CE621D3}"-->
<%
    Dim MyDocument 
    Set MyDocument = Server.CreateObject( "DynamicPDF.Document" )
    Dim MyPage 
    Set MyPage = MyDocument.AddPage()
    Dim MyLabel
    Set MyLabel = MyPage.AddLabel( "Hello World!", 0, 0, 100, 12 ) 
    MyLabel.Font = DPDF_Font_Helvetica 
    MyLabel.Align = DPDF_TextAlign_FullJustify
    MyLabel.FontSize = 12
    MyDocument.DrawToWeb True
    Set MyPage = Nothing
    Set MyDocument = Nothing
%>

Thanks,
ceTe Software Support Team.
 Feb 15 2011 12:22 PM
Thank you, this worked great.

As a follow-up with the COM v6.0 product, can you change the X Y coordinates once a label has been added to the page (using AddLabel method for the page object)? Everything else seems configurable after the addition but these two properties. Thanks again.
 Feb 15 2011 2:54 PM
Posted by a ceTe Software moderator
Hello,

Referring to the above example AddLabel() method is the only place where you can set the co-ordinates of the label. It is not possible to change the X & Y co-ordinates once the label is added to the page.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 1:33 AM.