Unicode Characters

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for COM/ActiveX (v8)  /  Re: Unicode Characters

DynamicPDF CoreSuite for COM/ActiveX (v8) Forum

 Feb 09 2018 2:26 AM
Hi,
I had downloaded a trail dll of dynamicPDF generator for Com. I am trying to print unicode characters to my pdf file. Can you plz give me sample codes for Visual Basic 6.0 to create pdf with unicode characters?
Regards
Rachna
 Feb 09 2018 9:12 AM
Posted by a ceTe Software moderator
Hello,

Yes, you can add symbol and special characters using the UNICODE values. Below is the VB6 code sample to add the copy right symbol. You will need to use the Decimal  UNICODE value. For example the Decimal number for Copy Right symbol is ‘169’.

    Dim objDoc As DynamicPDF.Document
    Set objDoc = New DynamicPDF.Document
    Dim objPage As DynamicPDF.Page
    Set objPage = objDoc.AddPage()
    
    Dim MyText
    MyText = "Copyright" & ChrW("169")
    Dim SetLFLabel
    Set SetLFLabel = objPage.AddLabel(MyText, 0, 30, 518, 18)
    
    'Add a page to the document
    Set objPage = objDoc.AddPage()
       
    'Save the file to disk in same folder as the app
    objDoc.DrawToFile (App.Path & "\HelloWorld.pdf")
    'Object cleanup
    Set objDoc = Nothing

Thanks,
ceTe Software Support Team.

 Feb 12 2018 12:05 AM
Hi,

Plz find below my function. I had arabic unicode strings stored in a txt file and I want to print those arabic strings in PDF file. But it is not
 printing.

Private Sub DrawHelloWorld()
    Dim objDoc As DynamicPDF.Document
    Dim objPage As DynamicPDF.Page
    Dim strText As String
    
    'Create Document object and set properties
    Set objDoc = New DynamicPDF.Document
    objDoc.Creator = "HelloWorld.vbp"
    objDoc.Author = "ceTe Software"
    objDoc.Title = "Hello World"

    'Add a page to the document
    Set objPage = objDoc.AddPage()
    
    'Add a textarea to the page
    strText = "Hello VB World..." & vbCrLf & "From the Dynamic PDF Generator Type Library." & vbCrLf & "DynamicPDF.com"
    Dim MyLabel As DynamicPDF.Label
    Set MyLabel = objPage.AddLabel(strText, 0, 0, 504, 54)
'    MyLabel.Align = DPDF_TextAlign_Center
'    MyLabel.Font = DPDF_Font_Helvetica
'    MyLabel.FontSize = 18
    
'    Dim MyText
'    MyText = "Copyright" & ChrW("169")
'    Dim SetLFLabel
'    Set SetLFLabel = objPage.AddLabel(MyText, 100, 230, 518, 18)
    
    
    Dim fso As New FileSystemObject
    Dim ts As TextStream
    Dim MyText
    Dim SetLFLabel
    
    Set ts = fso.OpenTextFile("C:\Users\Rachna\Desktop\Unicode.txt", , , TristateTrue)
    MyText = ts.ReadLine
    
    Set SetLFLabel = objPage.AddLabel(MyText, 100, 230, 518, 18)
    
       
    'Save the file to disk in same folder as the app
    objDoc.DrawToFile ("C:\Users\Rachna\Desktop\HelloWorld.pdf")
    
    'Display the file in the WebBrowser control
    'objPDF.Navigate App.Path & "\HelloWorld.pdf"
    
    'Object cleanup
    Set objDoc = Nothing
End Sub
 Feb 12 2018 9:31 AM
Posted by a ceTe Software moderator
Hello,

Can you please send over the following details to support@cete.com so we can look into it further?

1.        Output PDF.
2.        Exact version and build number of the DynamicPDF DLL file used in the application. You can get this information in DLL references properties (Version and Description fields) in Visual Studio.
3.        Sample text (UNICODE text) which you are adding to the PDF.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 8:13 PM.