How I can convert DOC,Excel,Xml,Html,Rtf 2 PDF using AMYUNI

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
kamleshvgujarathi
Posts: 39
Joined: Fri Jan 09 2004
Location: Bombay ( INDIA)
Contact:

How I can convert DOC,Excel,Xml,Html,Rtf 2 PDF using AMYUNI

Post by kamleshvgujarathi »

Hello :D ,

I had sent this question to support of amyuni but the I could not under stand from reply which I got

because I want to convert other format to PDF using amyuni so I am posting this question again to amyuni.

How Can I convert
  • Word Document
    Excel Document
    RTF Document
    HTML Document
    XML Document
to PDF Using amyuni. ?

If "Yes" then Please give sample of code so that I can test it ?

:?
Kamlesh
kamlesh@itshastra.com
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

All what you have to do is to print all these files to the PDF Printer so you will get pdf files.

You can find sample code on printing Word and Excel documents using the Word and Excel objects of Microsoft (ie, creating an instance of Word, opening a Word document and then printing it using the Printout method of the Word object) in our technical notes available at: http://www.amyuni.com/en/support/technotes.html

I will include here another method of generating pdf files from inside your application by using the BatchConvert() menthod of CDintfEx.

The below code will convert a bunch of html documents in a given folder to pdf, the pdf files name will be similar to the original files name.


Private Sub Command1_Click()

Dim pdf As New CDIntfEx.CDIntfEx

pdf.DriverInit PrinterName 'The printer should be installed on the system

pdf.EnablePrinter LicenseTo, ActivationCode

pdf.DefaultFileName = "C:\Temp\samples\BatchConvert.pdf"

' Set File options.
pdf.FileNameOptionsEx = NoPrompt + ConfirmOverwrite 'NoPrompt = 1, ConfirmOverwrite = 4096

pdf.BatchConvert "c:\Temp\samples\*.html"

' Reset 0ptions to zero
pdf.FileNameOptions = 0

End Sub


For further details about the use of the above functions please check the Developers' manual "Common Driver Interface 210.pdf" that you received with the PDF Converter.

Hope this helps.
Post Reply