I am creating an add-in in Revit 2017 . The application will export drawing sheets to PDF files. So, whenever I try to export a sheet, a dialog box appears to select the location to save. I tried to programmatically disable the Prompting program by adding a key to the Windows registry (as described in the Adobe documentation page 15-16 ).
Now the invitation has turned off, and now I am facing a problem. The problem is that Adobe Printer got stuck while creating the pdf file. See Image below: The progress bar of a PDF file seems to be frozen, I waited more than 10 minutes and it did not create a PDF file .
Can someone provide any fix? Appreciate any suggestion.

Edit here is the code I wrote for this purpose. Hope this helps identify the problem.
public static bool ExportSheetToPDF(Document doc, string path) { using (Transaction tx = new Transaction(doc) { tx.Start("Exportint to PDF"); PrintManager pm = doc.PrintManager; pm.SelectNewPrintDriver("Adobe PDF"); pm.Apply(); pm.PrintRange = PrintRange.Current; pm.Apply(); pm.CombinedFile = true; pm.Apply(); pm.PrintToFile = true; pm.Apply(); pm.PrintToFileName = path + @"\PDF\" + "abc.pdf"; pm.Apply(); SuppressAdobeDialogAndSaveFilePath(path + @"\PDF\" + "abc.pdf"); pm.SubmitPrint(); pm.Apply(); tx.Commit(); } return true; }
source share