Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Create and configure PDF from DWG file using Interop.Acrobat (C#)

Community Beginner ,
Jan 24, 2020 Jan 24, 2020

Hello, Adobe Community.

 

I have a very complex task to do and need to know if it's possible to achieve using Interop.Acrobat (or another Adobe solution that can use .NET Framework). 

 

Adobe Pro DC is installed and configured to accept AutoCAD (DWG) files. There's a set of drawings (a lot of them) that must be transformed into PDF files, but with the following changes:

  •  Define Settings to create all layouts and all layers (as showed in the picture below)

image1.jpg

 
 
  • Set the configuration preferences defining the styles used for AutoCAD files:
    image2.jpg
  • Generate PDF;
  • Apply Preflight "Digital printing (B/W)" (or any other one);
  • Set Page Boxes > check "Remove White Margins" option:
    image3.jpg
  • Save.
     

 

I'm a little sceptical that it's possible to do all of it using the Interop, but it would be great if all of this work.

 

For now, the only thing I could do was to open the DWG file to Acrobat DC, and the Settings window pops up (the first image above). I'm reading a lot of documentation on SDK but couldn't find anything that seemed to help me at the slightest (maybe I'm looking for it in a wrong way?)

 

It would be nice to know if this can be achieved using C, C++ or JavaScript libraries as well.

 

Thanks in advance.

TOPICS
Create PDFs , How to
2.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 25, 2020 Jan 25, 2020

Are you trying to develop a custom made action plugin to import .dwg files to PDF using Acrobat without the need of having AutoCAD installed in a computer?

 

See this answer: https://community.adobe.com/t5/acrobat/create-new-pdf-c/td-p/8265743 

 

Have you consulted the API Reference Guide:, specifically the Acrobat Distiller API Reference - Windows Automation :

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FDistiller_A...  

 

Is this going to be implemented on a server?

 

This is not my area, but I read your post and got curious.

 

I have to ask if this could be done easier by  applying your desired presets and exporting directly to PDF from the AutoCAD  software?

 

OR, are you trying to create a template to generate PDFs out of .dwg files?

 

See this thread: https://community.adobe.com/t5/acrobat/using-adobe-api-with-c-for-pdf-generation/td-p/9607656 

 

Are you getting any errors when you apply your workflow?

 

See this guidance for  "OdaWorkflow" involves registry  editing when converting .dwg files with no AutoCAD installed in a computer :

https://helpx.adobe.com/acrobat/kb/disable-popup-autocad-to-pdf.html 

 

 

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 27, 2020 Jan 27, 2020

Hello, ls_rbls. Thank you for your reply.

Ok, let me give you the full scenario:

 

  • We have Adobe Pro installed in a client machine (NOT SERVER) without AutoCAD, but it has Autodesk's TrueView (which is basically a "DWG Viewer"). This application can indeed plot as PDF, but the PDF is transformed into a image (in other words: is not "searchable"). Our client wants it "vectorized";
  • Only "Create PDF" from a DWG is not enough, since I also need to define page size, B&W colors and so on;
  • If I do the steps I mentioned in the first post, the result suffices the client's needs;
  • I've read the threads regarding SDK before, and also checked SDK documentation for IAC and couldn't find a way to define those particular configurations;
  • The AutoCAD popup is already disabled. What Adobe Pro shows when I use the code to open it is "Adobe Configuration Settings for Autocad documents" (uploaded in the first post);
  • We've already tried to use third-party libraries and none of them were approved by the client;
  • I'm not getting errors on my code, I just wasn't able to do nothing more than open Adobe Pro and create PDF from a given DWG file path. Became stuck after that;
  • I haven't used Distiller before and also don't know if it can do the same for me as the preset I mentioned before on Adobe Pro.
  •  

I'll check Distiller's documentation, but if someone with more knowledge of the tool could give me at least a path to go I would appreciate.

 

As I said before, I'm a little sceptical that Interop.Acrobat can do all this work, but I'd like to try. I believe no other library is more reliable when it comes to "create PDF" than Adobe's itself.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 27, 2020 Jan 27, 2020

Awesome! and tha k hou fkr the feedback.

 

Hopefully someone experienced in this area can assisy you.

 

I will continue to dig more info and if I find something relevant I'll post it back.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 27, 2020 Jan 27, 2020
LATEST

I really appreciate that! Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines