I've tried to create a single plot job that consists of multiple pages. Each
page is a single layer turned on and off in a loop.
To do this using multiple plots is not a problem and if you look at the
Autodesk.AutoCAD.PlottingServices.PlotEngine it looks like you should be
able to do this in a single plot job something like my example. But only the
first page gets printed.
The parameter lastPage in PlotEngine.BeginPage suggests that it should be
able to create a multi-page plot.
Has anyone suceeded with this?
_engine.BeginPlot(null,null);
_engine.BeginDocument(PlotInfo,"Autocad plot", null, 1 ,false,string.Empty);
for(int i = 1; i < pages.Count; i++)
{
ShowPage(pages[i-1]); // set single layer to on and all other to off.
Autodesk.AutoCAD.PlottingServices.PlotPageInfo PageInfo = new
Autodesk.AutoCAD.PlottingServices.PlotPageInfo();
_engine.BeginPage(PageInfo,PlotInfo,(i == pages.Count)
/*lastpage*/,null);
_engine.BeginGenerateGraphics(null);
_engine.EndGenerateGraphics(null);
_engine.EndPage(null);
}
_engine.EndDocument(null);
_engine.EndPlot(null);
Our application has multiple pages in one drawing.
There is two problems with creating one print job for each page:
1. If I create multiple print jobs and send them to a network printer other
users print jobs can sometimes be created inbetween my pages.
2. I annot create a multi-page PDF file in a simple way. (Need to create
postscript files and merege those with distiller afterwards).