DWF export to PDF


#1

Hello!

I would like to know if there is a way to convert a DWF file into PDF. I’ve found this documentation https://docs.aspose.com/display/cadnet/DWF+Drawings and tried to reproduce the same, but it says that the system is unable to read the dwf file.

The reason I am asking for this functionality is that, some users have IPAD and they want to see the drawings from it. Also there is no Autodesk Application supported for IOS. So I am trying to develop a web application to fulfill their requirements.

Does someone knows how to convert the DWF?

Thanks in advance.


#2

@felipecomps,

I have observed your requirements and suggest you to please try using latest Aspose.CAD for .NET 18.3 on your end. If there is still an issue then please share the source DWF file causing issue on your end and we shall investigate that further.


#3

Thanks for the reply @mudassir.fayyaz. I just tried the version 18.3 and the type DwfRasterizationOptions is no longer being recognized.
And, if I use CadRasterizationOptions instead, it throws the same error: “Unable to read dwf content”.

Also, debugging it, the problem lies on the Image.Load. Here’s what I have:

string MyDir = “C:\temp\”;
string fileName = MyDir + “2-1-406B.dwg.dwf”;

        var teste = Aspose.CAD.Image.CanLoad(fileName);

        using (Aspose.CAD.Image image = Aspose.CAD.Image.Load(fileName))
        {
            var pdfOptions = new PdfOptions();
            var dwfRasterizationOptions = new CadRasterizationOptions();
            pdfOptions.VectorRasterizationOptions = dwfRasterizationOptions;
            dwfRasterizationOptions.CenterDrawing = true;
            dwfRasterizationOptions.PageHeight = 500;
            dwfRasterizationOptions.PageWidth = 500;
            dwfRasterizationOptions.Layouts = new string[] { "Model" };
            // export
            string outPath = fileName + ".pdf";
            image.Save(outPath, pdfOptions);
        }

#4

@felipecomps,

Thank you for sharing the details with us. As requested earlier, please provide the source DWF file causing issue on your end so that I may investigate that to help you.


#5

testDrawing.zip (43.8 KB)

Ok, find it attached. Thanks again for the help.


#6

@felipecomps,

I have worked with the DWF file shared and have been able to observe the issue. An issue with ID CADNET-596 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.


#7

That’s great. Thank you!


#8

Hello.

Would you have an update on this?


#9

@felipecomps,

I have observed your comments. I regret to inform that issue is still unresolved. We will share good news with you soon. I request for your patience.


#10

Any luck on this one?

Thank you!


#11

@felipecomps,

I have observed your comments. I like to share that this issue is going to be resolved tentatively in Aspose.CAD 18.6. We will share good news with you soon.


#12

Hi,

I have a question on converting .dwf file to .pdf file by using C#/Asp.Net programming. Which version of Aspose.CAD .dll files should be used to convert .dwf version 00.06 (DWF V00.06) file to .pdf?


#13

@Gkrao,

I suggest you to please try using latest Aspose.CAD for .NET 18.8 on your end. If there is still an issue, please feel free to share the information with us along with used sample code and source files.


#14

I have tried several versions for e.g: Aspose.CAD for .NET 18.8, 17.12, 16.0 & even 1.0.0 but the program was throwing an error “Image loading failed.”.

Below is the code I have used to convert .dwf to .pdf file.

// The path to the documents directory.
string MyDir = “C:\Projects\WindowsFormsApplication1\WindowsFormsApplication1\”;
string sourceFilePath = MyDir + “2064jes.dwf”;
try
{
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 = 1600;
rasterizationOptions.PageHeight = 1600;

                // Set Auto Layout Scaling
                rasterizationOptions.AutomaticLayoutsScaling = true;

                // Create an instance of PdfOptions
                Aspose.CAD.ImageOptions.PdfOptions pdfOptions = new Aspose.CAD.ImageOptions.PdfOptions();

                // Set the VectorRasterizationOptions property
                pdfOptions.VectorRasterizationOptions = rasterizationOptions;

                MyDir = MyDir + "result_out.pdf";
                //Export the CAD to PDF
                image.Save(MyDir, pdfOptions);
                this.Close();
            } 

Please find the attached .dwf source file which is getting failed with all versions of Aspose.CAD dll.2064jes.zip (1.7 KB)


#15

@Gkrao,

Thank you for sharing the information with us. An issue with ID CADNET-692 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.


#16

Is there any timelines for this issue resolution? Actually we thought of purchasing license for this Aspose.CAD dll if the file conversion is happening successfully for old .dwf file?


#17

@Gkrao,

The issue has just recently been added in our issue tracking system and is pending in issues queue at the moment. We will be able to share any tentative ETA with you once the issue will be scheduled for investigation and resolution in our issue tracking system. We request for your patience till the time the investigation gets completed on our end.


#18

Found issue that sounds the same with the CAD 18.3 for Java - “com.aspose.cad.cadexceptions.ImageLoadException: Image Loading Failed”.
DWF attached.
VizProject3d.DWF.zip (2.9 MB)


#19

@simon.wiseman,

I have worked with the DWF file shared and have been able to observe the issue. An issue with ID CADJAVA-406 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.


#20

I’m experiencing exactly the same issue. Any solutions yet? Can we use an older version of the Aspose.CAD to get around the issue? I’m using 18.8.0.0