<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Export the sheet to pdf and suppress the dialog to save the file location in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7831391#M51913</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Probably not the answer you want but in the past I've used a &lt;A href="http://www.cutepdf.com/products/sdk/pdfwriter.asp" target="_blank"&gt;custom CutePDF writer&lt;/A&gt; to achieve this.&amp;nbsp; It allows you to create an uninterruptable print as you can specify the output path of the saved PDF.&amp;nbsp; It's not free though but does work very well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Mar 2018 15:15:24 GMT</pubDate>
    <dc:creator>grahamcook</dc:creator>
    <dc:date>2018-03-06T15:15:24Z</dc:date>
    <item>
      <title>Export the sheet to pdf and suppress the dialog to save the file location</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7830812#M51912</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm trying to export sheet in PDF format by using&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;solution (link &lt;A href="https://forums.autodesk.com/t5/revit-api-forum/how-to-export-view-sheet-set-to-pdf-dwg-and-dwf-format/m-p/7830096/highlight/true#M29220" target="_blank"&gt;here&lt;/A&gt;). So far the solution is perfect. However, whenever&amp;nbsp; I try to export the sheet a dialog box appears to choose the location to save. I was wondering&amp;nbsp; Is it possible to override the print driver settings, without a dialog popping up? I want to automatically choose the locations, rather than clicking it in the file system each time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here's the code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        public static void 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.PrintRange = PrintRange.Current;             
                pm.CombinedFile = true;            
                pm.PrintToFile = true;        
                pm.PrintToFileName = path + @"\PDF\" + "test.pdf";             

                pm.SubmitPrint();
                tx.Commit();

            }
            
        }&lt;BR /&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="surpress the dialog.PNG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/471455iD81F5DFB67792EA7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="surpress the dialog.PNG" alt="surpress the dialog.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Also, I don't want to change the '&lt;SPAN&gt;&lt;EM&gt;Printing Preferences&lt;/EM&gt;' setting because in that case dialog will be suppressed but the location where the pdf will be saved get hard coded. &lt;U&gt;I would like to provide the &lt;/U&gt;filepath&lt;U&gt; value from code dynamically.&amp;nbsp;&lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 12:24:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7830812#M51912</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-06T12:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Export the sheet to pdf and suppress the dialog to save the file location</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7831391#M51913</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Probably not the answer you want but in the past I've used a &lt;A href="http://www.cutepdf.com/products/sdk/pdfwriter.asp" target="_blank"&gt;custom CutePDF writer&lt;/A&gt; to achieve this.&amp;nbsp; It allows you to create an uninterruptable print as you can specify the output path of the saved PDF.&amp;nbsp; It's not free though but does work very well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 15:15:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7831391#M51913</guid>
      <dc:creator>grahamcook</dc:creator>
      <dc:date>2018-03-06T15:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Export the sheet to pdf and suppress the dialog to save the file location</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7832741#M51914</link>
      <description>&lt;P&gt;This is a common question here but it relates more to the PDF driver than Revit. There is a print to file in the settings Revit side&amp;nbsp;but this is often ignored by the driver.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example I believe&amp;nbsp;within the&amp;nbsp;Adobe PDF writer&amp;nbsp;there is a RegKey that can be set for a one time print to a specific path, so presumably you set this between prints. I never got it working due to virtualisation of the registry in my case&amp;nbsp;but is probably more straightforward outside of that on a local PC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The link below is old but there'll likely be a more recent equivalent. If you aren't using Adobe then you need to look for help based on what you are using.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/2075104/bypass-adobe-pdf-printer-savefileas-prompt" target="_blank"&gt;https://stackoverflow.com/questions/2075104/bypass-adobe-pdf-printer-savefileas-prompt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current solution is to spot the appearance of the window with the Win32 API, feed the window a filename and press the OK. Seems to work but I'm just waiting for the error when someone prints two things at the same time and two windows pop up. A bit of a ridiculous solution really, all in all.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 22:13:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7832741#M51914</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2018-03-06T22:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Export the sheet to pdf and suppress the dialog to save the file location</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7832805#M51915</link>
      <description>&lt;P&gt;Yep, that's pretty much how the Custom CutePDF printer works.&amp;nbsp; Pseudo code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set registry value "BypassSaveAs" to true&lt;BR /&gt;Set registry value "OutputFile" to required path&lt;/P&gt;&lt;P&gt;Set Revit Printer to CutePDF and set settings&lt;BR /&gt;Print drawing&lt;/P&gt;&lt;P&gt;Set registry value "BypassSaveAs" to false (so that standard UI use of the printer pops the Save Dialog)&lt;BR /&gt;Set registry value "OutputFile" to ""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Back in the day we found that the CutePDF option was cheaper especially if you buy a site licence.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 22:36:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7832805#M51915</guid>
      <dc:creator>grahamcook</dc:creator>
      <dc:date>2018-03-06T22:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Export the sheet to pdf and suppress the dialog to save the file location</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7834004#M51916</link>
      <description>&lt;P&gt;Thanks for the reply&amp;nbsp;@PTHOMAS108.&lt;/P&gt;&lt;P&gt;Now, the prompting got turned off and &lt;FONT color="#FF0000"&gt;now I'm facing another issue&lt;/FONT&gt;.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;The issue is the Adobe Printer got stuck while creating the pdf file&lt;/EM&gt;. See the below image:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;The PDF creating progress bar seems frozen, I waited for more than 10 mins and it didn't create the pdf file&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Can anybody provide any fix? Appreciate any suggestion.&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="adobe pdf error.PNG" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/471972i04696A81B36EE033/image-size/large?v=v2&amp;amp;px=999" role="button" title="adobe pdf error.PNG" alt="adobe pdf error.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 10:40:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7834004#M51916</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-07T10:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Export the sheet to pdf and suppress the dialog to save the file location</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7836393#M51917</link>
      <description>&lt;P&gt;You'll probably get better knowledge and support for this&amp;nbsp;on the Adobe forums.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I recall something similar happening.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 22:31:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7836393#M51917</guid>
      <dc:creator>RPTHOMAS108</dc:creator>
      <dc:date>2018-03-07T22:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Export the sheet to pdf and suppress the dialog to save the file location</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7837252#M51918</link>
      <description>&lt;P&gt;Thank you for your reply, I'm hoping to get some support from Adobe forum. Will share the solution, once it get fixed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Ali&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 08:26:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/7837252#M51918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-08T08:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Export the sheet to pdf and suppress the dialog to save the file location</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/11329049#M51919</link>
      <description>&lt;P&gt;Any solution found?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 17:19:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/11329049#M51919</guid>
      <dc:creator>WorldDue</dc:creator>
      <dc:date>2022-07-29T17:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Export the sheet to pdf and suppress the dialog to save the file location</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/11585719#M51920</link>
      <description>&lt;P&gt;Yes. Switch to Revit 2022 or Revit 2023 and use the built-in Revit PDF export functionality instead of some external driver:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2021/04/whats-new-in-the-revit-2022-api.html#4.2.3.1" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2021/04/whats-new-in-the-revit-2022-api.html#4.2.3.1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, please refer to&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1035859"&gt;@RPTHOMAS108&lt;/a&gt;&amp;nbsp; explanation above: it is a driver issue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 16:17:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/export-the-sheet-to-pdf-and-suppress-the-dialog-to-save-the-file/m-p/11585719#M51920</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-11-29T16:17:35Z</dc:date>
    </item>
  </channel>
</rss>

