WPCubed Product Support

Trouble with converting rtf to pdf

wpsupport

The artistic border style is not very common - it is not supported by our RTF engine.

#2 ♥ 0
3.8k Views 2 links 2 users read 2 min

I use trial version of ocx: wPDF_X04.ocx

and DLL: wPDFControlDemo04W.dll

The code I use:

Dim SrcFile$, DestFile$, PDF As New wPDF_X01.PDFControl, DLLName$
   
   SrcFile = "C:\1.rtf"
   DestFile = "C:\1.pdf"
   DLLName = "C:\wPDFControlDemo04W.dll"
   ' Initiate the OCX
'   Set PDF = CreateObject("wPDF_X01.PDFControl")
   ' Start Engine, last param =LIC_CODE
   If PDF.StartEngine(DLLName, "LIC_NAME", "LIC_KEY", 0) Then
      ' Start a PDF document
      If PDF.BeginDoc(DestFile, 0) Then
         ' Before RTF2PDF V3.5 you would have used this commands:
         PDF.ExecIntCommand 1000, 0 ' init RTF conversion
         PDF.ExecStrCommand 1002, SrcFile  ' load RTF file
         PDF.ExecIntCommand 1100, 0 ' convert it
         ' Finish PDF creation
         PDF.EndDoc
         PDF.StopEngine
      Else
         MsgBox "Cannot start PDF file"
      End If
   Else
      MsgBox "Cannot load RTF2PDF Engine from " + DLLName
   End If

It works and I get the pdf file, but it is wrong.

Instead of this:

[🖼 1-rtf.jpg (i.ibb.co)](rtf%20image)

I see this:

[🖼 1-pdf.jpg (i.ibb.co)](pdf%20image)

What must I do to get proper pdf file?

PS:

I don't know why I see "blocked image" message but if I click on link I see the image I have posted.

#1 ✎ ♥ 0