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

Free Support Forum - aspose.com

How to use .pc3 (or .ctb) files in ASPOSE.CAD (.Net)

Hello, community, right now I’m generating Jpgs and Pngs from a dwl file, but ASPOSE.CAD is not taking into consideration the format files.
Right now I’m assigning the file I want to use this way:

Pc3File = “myfile.pc3”

but the output is not affected in any means by it.
what am I doing wrong?
where is the documentation about this topic?
is it mentioned here as a feature: https://docs.aspose.com/cad/net/aspose-cad-for-net-20-11-release-notes/
but the link seems to be broken.

any help is greatly apreciated.

@IP1

Please consider following code snippet. May you kindly check whether an absolute path to your pc3 file is correctly formed?

        string fileName = "TestFile";
        string filePc3Name = "Pc3File";
        string file = this.GetFilePath(string.Format("{0}.dwg", fileName));
        string outFile = this.GetFilePath(string.Format("{0}.pdf", fileName));
        string filePc3 = this.GetPc3FilePath(string.Format("{0}.pc3", filePc3Name));
        using (FileStream inStream = new FileStream(file, FileMode.Open))
        using (Image image = Image.Load(inStream))
        using (FileStream stream = new FileStream(outFile, FileMode.Create))
        {
            ImageOptionsBase options = new PdfOptions();
            options.VectorRasterizationOptions = new CadRasterizationOptions();
            options.Pc3File = filePc3;
            image.Save(stream, options);
        }
1 Like

Hello Denis,

I’ve tried with relative paths and absolute paths, same result.
I do not have the GetPc3FilePath method, where is it located?

@IP1
GetPc3FilePath is a mnemonic name - means you use your own logic to obtain correct path.
May you kindly provide your source files (both dwg and pc3) - we will try to reproduce on our side