I have successfully created a program to create PDF files without reformatting the file name (Revit strips out dots and puts in dashes, and prefixes the file name with the entire model name). However, once the PDF is "created" it is still ported to Bluebeam Revu (where the REAL save to file is done). How do I get Revit to create the file with exactly the name specified, in the folder specified, without calling up the Bluebeam "intermediary" dialog?
//this is my code as written....string PDF_Path = "C:\\Revit Local\\" + Each_Sheet + " - " + Each_Name + ".pdf";IPrintSetting PDF_Sets = PDF_Manage.PrintSetup.CurrentPrintSetting;PrintParameters PDF_Params = PDF_Sets.PrintParameters;PDF_Params.PaperSize.Equals(Use_Size);PDF_Params.PageOrientation = PageOrientationType.Landscape;PDF_Params.ZoomType = ZoomType.Zoom;PDF_Params.Zoom = 100;PDF_Params.PaperPlacement = PaperPlacementType.Center;PDF_Params.HideReforWorkPlanes = true;PDF_Params.HideUnreferencedViewTags = true;PDF_Params.HideCropBoundaries = true;PDF_Params.HideScopeBoxes = true;PDF_Params.ColorDepth = ColorDepthType.GrayScale;PDF_Manage.SubmitPrint(uiDoc.ActiveView)PDF_Manage.PrintToFileName = "MyFileNameVariable.pdf";
I tried the various options of "...PrintParameters" and none seemed to suppress the dialog called up by the printer defined.
Best Answer
There is no direct method with BlueBeam. You have to start the BlueBeam administrator and uncheck the "Prompt for file name" option (which if turned on calls up the dialog control of BlueBeam Revu). When you turn it off, your files (with the correct name but not path) are placed in your MyDocuments folder (accessed via the following :
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
After the files are created (note that "conversion", etc, might delay them being available to copy), you can copy them over to the FOLDER designated by your PDF_Mage.PrintToFileName. I did this by inserting a TaskDialog to pause until ready.
Here is a complete sample demonstrating how you can print to PDF and control the output filename and path:
http://thebuildingcoder.typepad.com/blog/2013/06/auto-pdf-print-from-revit-2014.html