Can anyone convert this from .NET to PowerBuilder?

If you are a Power Builder developer and have any questions about using our products from Power Builder here is the place to post them.
Post Reply
lump10670
Posts: 4
Joined: Thu Feb 01 2007

Can anyone convert this from .NET to PowerBuilder?

Post by lump10670 »

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
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

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

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
Hope this helps.
Post Reply