Different results from tiff / pdf output

Hi all,

We tried out to convert CAD drawings to tiff and pdf and got different results.

The pdf seems fine but the tiff version is “cut” in the right corner. Any idea what I’ve might have done wrong?

Options set:

CAD:

var rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();

rasterizationOptions.PageWidth = 950;

rasterizationOptions.PageHeight = 600;

rasterizationOptions.AutomaticLayoutsScaling = true;

rasterizationOptions.CenterDrawing = true;

TIFF:

var tiffOptions = new Aspose.CAD.ImageOptions.TiffOptions(Aspose.CAD.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);

tiffOptions.VectorRasterizationOptions = rasterizationOptions;

PDF:


var pdfOptions = new Aspose.CAD.ImageOptions.PdfOptions();

pdfOptions.VectorRasterizationOptions = rasterizationOptions;

Kind
regards,

Flaviu

Hi Flaviu,
Thank you for your inquiry and sharing sample. This is to update you that we have investigated the issue at our end. We are unable to observe the said issue with TIFF format. Code snippet and resultant TIFF image is attached for your reference. We have used the latest version of Aspose.CAD for .Net.

CODE:

string sourceFilePath = @"L2017B.dxf";
using (Aspose.CAD.Image image = Aspose.CAD.Image.Load(sourceFilePath))
{
// Create an instance of CadRasterizationOptions and set its various properties
Aspose.CAD.ImageOptions.CadRasterizationOptions rasterizationOptions = new Aspose.CAD.ImageOptions.CadRasterizationOptions();
rasterizationOptions.PageWidth = 1000;
rasterizationOptions.PageHeight = 800;
rasterizationOptions.ScaleMethod = Aspose.CAD.FileFormats.Cad.ScaleType.GrowToFit;
rasterizationOptions.CenterDrawing = true;
// Create an instance of TiffOptions
Aspose.CAD.ImageOptions.TiffOptions tiffOptions = new Aspose.CAD.ImageOptions.TiffOptions(Aspose.CAD.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// Set the VectorRasterizationOptions property
tiffOptions.VectorRasterizationOptions = rasterizationOptions;
// Export CAD to TIFF
image.Save(@"L2017B_out_dxf.tiff", tiffOptions);
} 

Hi,

thanks a lot for your quick response. I guess my problem is understanding the PageWidth/PageHeight properties.

I used 950/600 for Width/Height (see op) but the resulting tiff is 1267x800, and strangely the resulting PDF is actually 950x600. I’m guessing that’s why my resulting tiff looks wrong.

So I’m wondering now why my tiff is not the expected 950x600 as the PDF?

Thanks a lot,

Flaviu

Hi Flaviu,

Thank you for writing us back.

This is to update you that we are able to observer the said issue. The issue has been logged into our system with ID CADNET-260. Our product team will further look into it and provide feedback. We will update you with the feedback via this forum thread.

Hi all,

I have another question regarding the scaling method. Since the dxf CAD drawing contains the mm length specification is it possible to convert the CAD drawing to a pdf/tiff with a certain pixel/mm ratio?

So instead of specifying page width/height I’d specify the pixel/mm ratio (e.g. 1) and the
image (width/height) is than automatically generated to fit the pixel/mm ratio.

Kind regard,
Flaviu

Hi Flaviu,

The feature you have mentioned is implementable. This is to update you that our product team is already working on the same idea. Hopefully the feature can be available in the release 17.02. We have asked our product team to provide more details about it. We will update you with the details once available via this forum thread.

Hi Flaviu,

This is to update you that Aspose.CAD for .Net 17.02 has been released and available for download. Aspose.CAD for .Net now provides UnitType enumeration to adjust the size of drawing during conversion of the CAD format. Please download the version and try UnitType at your end. Follow the link Adjusting CAD Drawing Size for details.

@flaviu.iovanescu,

Can you please share the feedback if the issue is resolved on your end or you are still facing the issue. We may close the ticket otherwise on our end.

The issues you have found earlier (filed as CADNET-260) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by mudassir.fayyaz

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.