
Problem using Crystal Report 8.5 to export PDF in Visual Basic 6.0
I'm trying to export a
Crystal Report 8.5 to Adobe Acrobat, to create
a PDF file in
Visual Basic 6. I met the following problems:
Problem One - Using Crystl32.OCX, the control does not have export pdf
format to select.
Report.ReportFileName ="c:\mytest.rpt"
Report.PrintFileName = "c:\pdf_report.pdf"
Report.Destination = crptToFile
Report.PrintFileType = <----- Cannot select PDF Format
Therefore, I'm using the following function to export PDF format.
Dim appl As New CRAXDRT.Application
Dim rep As CRAXDRT.Report
Set rep = appl.OpenReport("c:\mytest.rpt", 1)
rep.ExportOptions.DiskFileName = "c:\pdf_report.pdf"
rep.ExportOptions.DestinationType = crEDTDiskFile
rep.ExportOptions.FormatType = crEFTPortableDocFormat
rep.Export False
Can I use OCX Control to export PDF in Visual Basic?
Problem Two - After I used CRAXDRT object to export PDF, I found out
the problem. That is:
In mytest.rpt, it is using UniversCondensed Fonts. So, I exported it
to a PDF file in my PC (but my PC don't have this fonts).
It exported to a PDF successfully. When I opened it, the error message
appears "Unable to find or create the font 'UniversCondensed'. Some
characters may not display or print correctly."
If I installed this fonts, it displays very well. But in some reasons,
I do not want to install this fonts and I can see it well.
If I'm used a PDF Writer to print this report to a PDF, the PDF do not
use UniversCondensed Fonts if my PC do not have this fonts. It used a
Arial Fonts instead of this fonts. So, I can see it very well. In some
reasons, I cannot use PDF writer to print report to PDF, I MUST use
CRAXDRT object to export PDF.
Therefore, I have a question, how can I export to a PDF that the PDF
file can use a Arial Fonts instead of UniverseCondensed Fonts?
Can I specify the fonts to export a PDF?
Thanks a lot!