Message 1 of 4

Not applicable
04-03-2018
04:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have installed PDF995 print driver and trying to hook it up when printing from Revit API.
The problem is, that Revit gives the following warning:
"PDF995 cannot be used with Main Drawings print settings. The <in-session> print settings will be used".
How can I suppress this warning?
Here is my code:
foreach (ViewSheet sheet in new FilteredElementCollector(openDoc).OfClass(typeof(ViewSheet)).Cast<ViewSheet>()) { var viewType = GetViewType(sheet); if (viewType == ViewType.Unknown) { continue; } using (var transaction = new Transaction(openDoc, "save setting")) { transaction.Start(); var printManager = openDoc.PrintManager; printManager.SelectNewPrintDriver("PDF995"); printManager.PrintToFile = true; var setting = printManager.PrintSetup.InSession; var failOptions = transaction.GetFailureHandlingOptions(); failOptions.SetFailuresPreprocessor(new WarningSwallower()); transaction.SetFailureHandlingOptions(failOptions); var paperSize = GetPaperSize(sheet); setting.PrintParameters.PageOrientation = paperSize.PageOrientation; ... printManager.PrintSetup.CurrentPrintSetting = setting; printManager.PrintSetup.SaveAs("Tempsetting" + plotSettingsNumber.ToString()); printManager.Apply(); if (printManager.SubmitPrint(sheet)) { // Success plotSettingsNumber++; ImageExportService.ExportSheet(sheet, pdf.PngFilePath, true); } else { // Failure } transaction.RollBack(); } }
I'm using WarningSwallower, as suggested in this post http://thebuildingcoder.typepad.com/blog/2016/09/warning-swallower-and-roomedit3d-viewer-extension.h..., but it doesn't seem to work here.
I appreciate any help.
Solved! Go to Solution.