All Image are not generated

The attached Orignal File Contains 3 images, but While convert to tif, it will generate only 2 image
Issue.PNG (3.9 KB)

Sample Code:
using (Aspose.CAD.Image image = Aspose.CAD.Image.Load(new FileStream(@“file.dxf”, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)))
{
Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
rasterizationOptions.PageWidth = 2250;
rasterizationOptions.PageHeight = 3300;
var options = new Aspose.CAD.ImageOptions.TiffOptions(Aspose.CAD.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
options.ResolutionSettings = new Aspose.CAD.ResolutionSetting() { HorizontalResolution = 300, VerticalResolution = 300 };
options.VectorRasterizationOptions = rasterizationOptions;
options.Compression = Aspose.CAD.FileFormats.Tiff.Enums.TiffCompressions.CcittFax4;
image.Save($@“cad.tif”, options);
}

Required Files: Cad File Less Image generate.zip (88.1 KB)

@hemalp,
Hi.
Usually layout can be missing if it is default one (contains no additional information compared to Model), such layouts are ignored by default. You may add this option for RasterizationOptions and set up printing all layouts always:

Layouts = new List<string>(cadImage.Layouts.KeysTyped).ToArray()

I’m afraid I can not see 3 images in the original file, I have attached 2 screenshots from AutoCAD and ODA Viewer, both of them show Model and Layout1 only as well as other viewers. Could you please test the file from archive you attached here one more time with your viewer and specify what viewer you use?
layoutsODA.png (21.2 KB)
layoutsAutoCAD.png (57.1 KB)

Hello @oleksii.gorokhovatskyi

CAD file all pages is not print properly, can you please give me code sample for print all pages print(Tiff generation) properly with all option(rasterizationOptions) apply.

Code Sample :
using AsposeCad = global::Aspose.CAD;
using (AsposeCad.Image image = AsposeCad.Image.Load(new FileStream(@"…\CAD\InputFile\Test02.dxf", FileMode.Open, FileAccess.Read, FileShare.ReadWrite)))
{
AsposeCad.ImageOptions.CadRasterizationOptions rasterizationOptions = new AsposeCad.ImageOptions.CadRasterizationOptions();
rasterizationOptions.PageWidth = 2250;
rasterizationOptions.PageHeight = 3300;
var options = new AsposeCad.ImageOptions.TiffOptions(AsposeCad.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
options.ResolutionSettings = new AsposeCad.ResolutionSetting() { HorizontalResolution = 300, VerticalResolution = 300 };
options.Compression = AsposeCad.FileFormats.Tiff.Enums.TiffCompressions.Lzw;
for (int i = 0; i < ((AsposeCad.FileFormats.Cad.CadImage)image).Layouts.Count; i++)
{
image.Save($@"…\CAD\cad{i}.tiff", options);
}
};

InputOutput Sample:
Cad_Issue.zip (59.6 KB)

Please find above attachment of code sample, input sample and required output.

@hemalp,
such few fixes are required in this code sample:

...
 rasterizationOptions.DrawType = CadDrawTypeMode.UseObjectColor;
...
options.VectorRasterizationOptions = rasterizationOptions;

// and the export will be like this
List<string> allLayouts = image.Layouts.KeysTyped.ToList();

for (int i = 0; i < allLayouts.Count; i++)
{
     rasterizationOptions.Layouts = new string[] { allLayouts[i] };
     rasterizationOptions.ExportAllLayoutContent = true;

     image.Save(..., options);
}

but unfortunately we can not get the desired result. We need to check both reading and export of this file. You are referring to have 3 images as desired result but I tested few viewers and all can find only Model and Layout1 here, no one can find more layouts.png (2.9 KB). We have created task mentioned below to investigate this file better.

@hemalp
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CADNET-9361

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as CADNET-9361) have been fixed in this Aspose.CAD for .NET 23.10 update. This message was posted using Bugs notification tool by oleksii.gorokhovatskyi