We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

New to ASPOSE - Using Windev

Hi! We just bought licenses for Imaging and OCR .NET and I am trying to implement the following code but I’m getting an error with the Load (file) function in Windev. Anyone implemented the Aspose .NET assembly in Windev? If you have a working example, please share… :slight_smile:


Thx!

Dim sourceFilePath As String = myDir & “office.dwg”
Using image As Aspose.Imaging.Image = Aspose.Imaging.Image.Load(sourceFilePath)
'Create an instance of CadRasterizationOptions and set its various properties
Dim rasterizationOptions As New Aspose.Imaging.ImageOptions.CadRasterizationOptions()
rasterizationOptions.BackgroundColor = Aspose.Imaging.Color.White
rasterizationOptions.PageWidth = 1600
rasterizationOptions.PageHeight = 1600
'Create an instance of PdfOptions
Dim pdfOptions As New Aspose.Imaging.ImageOptions.PdfOptions()
'Set the VectorRasterizationOptions property
pdfOptions.VectorRasterizationOptions = rasterizationOptions

'Export the DWG to PDF
image.Save(myDir & <span class="code-quote" style="color: rgb(0, 145, 0); background-color: inherit;">"result.pdf"</span>, pdfOptions)

End Using

Hi Benoit,

Thank you for your inquiry.

Please note that we need to know which version of Aspose.Imaging you are using and want you to share the sample DWG file with us. This will help us to investigate the issue.

Looking forward for your reply along with Aspose.Imaging version information and DWG file sample.

Hi! Aspose Imaging and OCR versions are both 3.1,0


Actually, I do not have a specific DWG file at the moment. I’m currently working on the translation of the VB code into Windev in order to use the .NET assembly.

Thanks!

JD

Hi JD,

Your code works in Visual Studio however we have not tested it with WinDev. We will try to set up that environment at our end and share our findings with you.

Best Regards,

Hi!


I was able to verify the license using the following code in Windev (version 20):

// ASPOSE License

gpclAsposeImagingLicense is an object “Aspose.Imaging.License” dynamic = new “Aspose.Imaging.License"
gpclAsposeOCRLicense is an object “Aspose.OCR.License” dynamic = new “Aspose.OCR.License"

gpclAsposeImagingLicense.SetLicense(fRepExe+”\Aspose.Imaging.lic”)
IF NOT gpclAsposeImagingLicense.IsLicensed THEN
EndProgram(“ASPOSE.Imaging License Error”)
END

gpclAsposeOCRLicense.SetLicense(fRepExe+"\Aspose.OCR.lic")
IF NOT gpclAsposeOCRLicense.IsLicensed THEN
EndProgram(“ASPOSE.OCR License Error”)
FIN


But I am getting an error trying to open a DWG file in order to convert it to JPG:

gsSoFile=fRépertoireTemp()+fExtraitChemin(sFile,fFichier)+".JPG"
pclAsposeImage is an object “Aspose.Imaging.Image” dynamic = “Aspose.Imaging.Image”
pclAsposeImage.Load(sFile) // This line is generating an error saying that the Load element does not exist in the Image class.

pclAsposeImage.Save(gsSoFile,Null)


Hi JD,

Load is a static method of Image class and it will not be available when you call it through the object of Image class. Please contact Windev team for more details on how to call a static method in Windev.

Best Regards,