Search code examples
c#model-view-controllerpdftron

How do I display .dwg file in PDFTron


I am using MVC. I have downloaded webviewer from PDFTron and I am able to view PDF file but I am not able to view .dwg file. How can it be done. Thanks


Solution

  • While many file types can be viewed directly client side in the browser (e.g. PDF, DOCX, XLSX, PPTX, PNG, JPG) some file types require a server side component.

    The CAD formats are among these server side required file formats. https://www.pdftron.com/documentation/web/guides/file-format-support/#cad

    There are two options, as you can see from the link above.

    The first option is to run the optional WebViewer Server (Docker) container and it can do the CAD processing for you. Once you have WebViewer Server connected to WebViewer you can just give WebViewer the URL to the DWG file and WebViewer Server will convert on the fly for WebViewer. https://www.pdftron.com/documentation/web/guides/wv-server-deployment/

    The second option is you can download the PDFNet C# .NETCore SDK and the external CAD module and convert DWG to PDF on your own server, and then give the URL of the new PDF file to your WebViewer. https://www.pdftron.com/documentation/linux/get-started/dotnet-core/ https://www.pdftron.com/download-center/linux/?language=All#sdk-downloads_net-core-64bit https://www.pdftron.com/download-center/linux/?language=All#modules_cad-conversion-module https://www.pdftron.com/documentation/samples/#cad2pdf