I downloaded the .dwg file you sent and converted it by changing the CAD2PDF sample:
The error no filename usually means that you are passing the file into the function incorrectly. Could you reproduce the error by changing the CAD2PDF sample? If so, please send your code snippet so we can further investigate.
Your attempt at the demo WebViewer errored. The drawing you see there is just the default one. If you look at the request using the browser’s developer tools, you’ll see the same error that I posted previously.
I have also tried this using a simple console app and as expected saw the same error.
pdftron.Common.PDFNetException
HResult=0x80131500
Message=Exception:
Message: Error converting CAD content using CAD2PDF module Add-On. PDFTron Converter Error: No filename
Conditional expression: false
Version : 9.5.0-1bc49d6a54
Platform : Windows
Architecture : AMD64
Filename : Convert.cpp
Function : trn::PDF::Convert::FromCAD
Linenumber : 1579
Source=PDFTronDotNet
StackTrace:
at pdftron.Common.PDFNetException.REX(IntPtr result)
at pdftron.PDF.Convert.FromCAD(PDFDoc in_pdfdoc, String in_filename, CADConvertOptions options)
at Program.$(String[] args) in C:\Users\alans\source\repos\PDFTron.CADtoPDF\Program.cs:line 18
Code below:
// See https://aka.ms/new-console-template for more information
using pdftron.PDF;
using pdftron;
using pdftron.SDF;
var pdfTronPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..\\..\\..\\Lib\\Windows\\");
PDFNet.Initialize("Replace with Licence Key");
PDFNet.AddResourceSearchPath(pdfTronPath);
if (!CADModule.IsModuleAvailable())
{
Console.WriteLine("Apryse SDK CAD module not available.");
}
using (PDFDoc doc = new PDFDoc())
{
var inputFilePath = "C:\\Users\\alans\\Downloads\\C301 Stage 1 Roading Plan.dwg";
var outputFilePath = "C:\\Users\\alans\\Downloads\\C301 Stage 1 Roading Plan.pdf";
pdftron.PDF.Convert.FromCAD(doc, inputFilePath, null);
doc.Save(outputFilePath, SDFDoc.SaveOptions.e_remove_unused);
}