Hello jose,
Can you give a snippet for RTF file to PDF Conversion. ?
Kamlesh
RTF to PDF example.
-
- Posts: 39
- Joined: Fri Jan 09 2004
- Location: Bombay ( INDIA)
- Contact:
Hello Kamlesh,
There are two ways to convert RTF files to PDF:
1 - By using the BatchConvert() methods that can convert all RTF files in a given folder to PDF in batch mode
2- By opening each RTF file in Word and printing it to the PDF Printer.
I will add here VB samples for both methods so you can choose the one that best suits you.
Hope this helps
There are two ways to convert RTF files to PDF:
1 - By using the BatchConvert() methods that can convert all RTF files in a given folder to PDF in batch mode
2- By opening each RTF file in Word and printing it to the PDF Printer.
I will add here VB samples for both methods so you can choose the one that best suits you.
Code: Select all
'This sample converts all RTF files in the Temp folder to one pdf file called 'BatchConvert.pdf
'All RTF files are appended to one PDF. If you remove the Concatenate 'option each RTF file will be converted to a separate pdf
pdf.FileNameOptions = NoPrompt + UseFileName + Concatenate
pdf.DefaultFileName = "c:\Temp\BatchConvert.pdf"
pdf.BatchConvert("c:\Temp\*.rtf")
Code: Select all
'Printing an rtf file while opening it using Word.
'Declarations
'Create a new hidden instance of Word
Set wordapp = New Word.Application
'Create an instance of a Word document
Set worddoc = Word.Documents
' Attach to the existing PDF Printer (Initialize the printer)
pdf.DriverInit (PrinterName)
' Set the PDF Printer as Default
pdf.SetDefaultPrinter
pdf.DefaultFileName = "C:\Temp\Test.pdf"
' Set File options.
pdf.FileNameOptionsEx = NoPrompt + UseFileName
' Open the rtf document
Set worddoc = Documents.Open("C:\Temp\Test.rtf", , , , , , , , , , , True)
' Print the rtf document
worddoc.PrintOut ActivePrinter = PrinterName
worddoc.Close
pdf.FileNameOptions = 0
Hope this helps
-
- Posts: 39
- Joined: Fri Jan 09 2004
- Location: Bombay ( INDIA)
- Contact:
-
- Posts: 39
- Joined: Fri Jan 09 2004
- Location: Bombay ( INDIA)
- Contact: