System.IO.FileStream file1 = new System.IO.FileStream("test.pdf",
FileMode.Open, FileAccess.Read);
This is my code
#IF DEFINED PBDOTNET THEN
Amyuni.PDFCreator.IacDocument doc1obj
doc1obj = create Amyuni.PDFCreator.IacDocument
System.IO.FileStream file1 = new System.IO.FileStream("test.pdf",
FileMode.Open, FileAccess.Read)
doc1obj.Open(file1,"")
doc1obj.Print( "Amyuni PDF Converter", true )
#END IF
Can anyone convert this from .NET to PowerBuilder?
Hello,
i don't know how to create a File Object in Powerbuilder and open it in a given mode, but i can give you a powerbuilder code to open a pdf file and print it to the PDF Printer or any other printer on your system. This code uses CDIntf of the PDF Converter
Hope this helps.
i don't know how to create a File Object in Powerbuilder and open it in a given mode, but i can give you a powerbuilder code to open a pdf file and print it to the PDF Printer or any other printer on your system. This code uses CDIntf of the PDF Converter
Code: Select all
// create the new ole object.
doc1 = create oleobject
// Connect the doc1 ole object to the cdintfex interface of CDIntf250.dll
doc1.ConnectToNewObject("cdintfex.document")
//SetLicenseKey() Should be called in version 2.1 and above before advanced operations like adding encryption, linearization , export to RTF and HTML
doc1.SetLicenseKey(LicensedTo, ActivationCode)
// Open the pdf file you want to print
doc1.OpenEx("C:\Test.pdf", "")
// Print the document to a printer
doc1.Pint "Amyuni PDF Converter", 1) // 1 stands for the bool value True
// Destroy doc1 object
Destroy doc1