
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I have tried (a lot) to get the right orientation and papresize in a pdf plot
I got the right printer, the right filename
but not the right papersize and orientation, I am usingBoundingBoxUV to get the Sheetsize and from there the orientation of the sheet
that works fine 🙂
I have been trying with 3 different pdf printers, without luck 😞
My the code looke like this, in this case I am trying to print all shests starting with an "A" to be printet in A3.
PrintManager PrintM = OpenDoc.PrintManager;
PrintM.PrintSetup.CurrentPrintSetting = PrintM.PrintSetup.InSession;
PrintM.SelectNewPrintDriver("PDF995"); //("CutePDF Writer")("PDF995")("PDFCreator")
PrintM.PrintToFile = true;
foreach (ViewSheet vs in new FilteredElementCollector(OpenDoc).OfClass(typeof(ViewSheet)).Cast<ViewSheet>())
{
if (vs.SheetNumber[0].ToString() != "A")
{
PDF_Name = vs.SheetNumber.Substring(0, vs.SheetNumber.Length - 3);
PrintM.PrintToFileName = DistFolder + @"\" + Department_number.AsString() + "-" + PDF_Name;
PaperSizeSet PaperSizeSet = PrintM.PaperSizes;
PrintM.PrintSetup.CurrentPrintSetting.PrintParameters.PageOrientation = PageOrientationType.Portrait;
foreach (PaperSize PS in PaperSizeSet) // Finding the right papersize in the printer
{
if (PS.Name.ToString() == "A3")
{
PrintM.PrintSetup.CurrentPrintSetting.PrintParameters.PaperSize = PS;
break;
}
}
PrintM.Apply();
PrintM.SubmitPrint(vs);
}
} // end of foreach (ViewSheet vs........
What do I do wrong ??
Regards
Anders
Solved! Go to Solution.