DWG - Empty file generated

Hi!

We're also working on adding image preview to the software that we are writing. We decided on ASPOSE Imaging because it gives us the possibility to view and AutoCAD DWG files to PDF.

For now, we are only getting an empty file generated by the Imaging .NET process.

The code and the DWG file are attached. We run the following code that is calling the rest of the procedures. A line beginning with // is a comment.



PROCEDURE plf_Transform_PDF()

blm_Result is boolean

sgf_File_DWG = CompleteDir(fExeDir()) + "Demo.dwg"
//sgf_File_DWG = CompleteDir(fExeDir()) + "conic_pyramid.dxf"
//sgf_File_DWG = CompleteDir(fExeDir()) + "Sampleocr.bmp"

IF NOT fFileExist(sgf_File_DWG) THEN
STOP
RETURN
END

plf_Image_Open_cad()

plf_Layers_List()

plf_Layouts_List()

plf_Image_Close_cad()

//DeleteAll(tbgf_Feuilles)
//Add(tbgf_Feuilles, "demo-Objet")
//Add(tbgf_Feuilles, "demo-Layout1")
//Add(tbgf_Feuilles, "demo-Layout2")

plf_Rasterization_Options()

plf_Image_Open()

blm_Result = plf_Export_PDF()

plf_Image_Close()

IF NOT blm_Result THEN
STOP
RETURN
END
Info("Fichier PDF généré" + CR + sgf_File_PDF)



Please let me know if we're doing it wrong and how to correct our code.

Thank you!

JD
Hi Benoit,
Thank you for your inquiry and providing sample files.
Please go through the following links for details on converting DWG to PDF.


Furthermore, the sample DWG file contains 3D entities. You may instruct exclusively in the code that 3D entities have been used. Following is the line of code:

VectorRasterizationOptions rasterizationOptions =
new CadRasterizationOptions
{
// Other options
TypeOfEntities = TypeOfEntities.Entities3D,
};

Hope the above information helps. Feel free to reach us in case of any query or comments.
Hello and thank you for your reply!

I got a little further now. But I still can't get anything else than a black and white skeleton of the original image (files attached). So here are my 3 questions:

1. How can I improve the result of the conversion?
2. Why are 2 pages generated (always 1 empty on all conversion)?
3. Why is the test.dwg file generating an error at the following command (line 27, it is the only one that crashes the program)?

olm_Layers <- ogf_Image_CAD.Layers

Although, from the error message, I think that I got my answer:
Aspose.Imaging.Exceptions.ImageLoadException: Image loading failed. ---> Aspose.Imaging.Exceptions.ImageFormats.CadException: The dwg version isn't valid. Only R2004 and R2010 version are currently supported.

Will you support these versions in upcoming releases?


I also attached the code that generated the resulting PDF files.

Thanks again!

JD


Hi Benoit,

Thank you for your inquiry and providing samples.

We have tried to reproduce the issue using demo.dwg file at our end. It was found that the issue persists. The issue has been logged into our issue tracking system with ID CAD-81. Furthermore support for format DWG R12 is not currently available. We have logged a feature request into our system with ID CAD-80. Our product team will look into it. We will update you accordingly on both of the tickets via this forum thread.

Hello and thanks again for the quick reply.

To recap:

Some documents are rejected with an error (wrong version) - example already sent

Some documents are not converted with colors (only B&W) - example already sent

All documents have one blank page at the end when converted to PDF - example already sent

Some documents are converted but only output blank pages - example attached today

Thanks again!

JD
Hi Benoit,

Thank you for the information.

The files will be shared with product team. We will update you accordingly via this forum thread once any update will be available.

Hi Benoit,

Thank you for your patience.

This is to update you that ticket IDs CAD-81 & CAD-80 are not yet resolved. Implementing support for 3D objects is a very complicated feature to develop. It will take time. Estimated ETA for this feature is by end of year 2017. The reason is that when we will fix the issue with this particular image and you will try to render some other 3D image, you will not get the expected results.

Regarding support for DWG R11 & R12 formats, the estimated ETA is end of current year. Our product team has planned to start working on this issue in the 4th quarter of year 2016. Furthermore there can be a workaround regarding ticket ID CAD-80 that is about support for format DWG R12. As a workaround you may try converting the images to new format such as DWG 2010. We already support this version of DWG format.

We are sorry for the inconvenience.

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