彩票走势图

VectorDraw Developer Framework的PDF多页打印技巧

原创|使用教程|编辑:郝浩|2013-05-14 14:10:42.000|阅读 245 次

概述:本文列举了VectorDraw Developer Framework的两种PDF多页打印技巧

# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>

CAD绘图控件 VectorDraw Developer Framework 从6.11版开始在PrinterRender对象中新增了一个方法:ExportMultiPagePDF,这个方法可以输出多页PDF文件。下面跟大家列举两种多页打印PDF的应用技巧。

1、下面这个示例演示输出PDF文件单独页面的所有布局:

int numprinters = vdFramedControl.BaseControl.ActiveDocument.LayOuts.Count + 1;
vdPrint []printers = new vdPrint[numprinters];
int i = 0;
printers[i] = vdFramedControl.BaseControl.ActiveDocument.Model.Printer;
printers[i].PrintExtents();
printers[i].PrintScaleToFit();
i++;
foreach (vdLayout layout in vdFramedControl.BaseControl.ActiveDocument.LayOuts)
{
printers[i] = layout.Printer;
i++;
}
VectorDraw.Render.PrinterRender.ExportMultiPagePDF(new RenderFormats.PdfRender(), vdFramedControl.BaseControl.ActiveDocument, printers, @"C:\Documents and Settings\Administrator\Desktop\test.pdf");

2、如果你的绘图没有布局,只有模型,想把多个PDF页面中的模型打印出来,那请参考下面的代码:

int numprinters = 2; //two pages = two regions
VectorDraw.Professional.vdObjects.vdPrint[] printers = new VectorDraw.Professional.vdObjects.vdPrint[numprinters];
int i = 0;

//set the first printer settings and printable area
printers[i] = new VectorDraw.Professional.vdObjects.vdPrint(vdFramedC.BaseControl.ActiveDocument.Model.Printer);
printers[i].PrintWindow = new VectorDraw.Geometry.Box(new VectorDraw.Geometry.gPoint(-2, -1), new VectorDraw.Geometry.gPoint(866, 1122));
printers[i].PrintScaleToFit();

//set the second printer settings and printable area
i++;
printers[i] = new VectorDraw.Professional.vdObjects.vdPrint(vdFramedC.BaseControl.ActiveDocument.Model.Printer);
printers[i].PrintWindow = new VectorDraw.Geometry.Box(new VectorDraw.Geometry.gPoint(-2, -1458), new VectorDraw.Geometry.gPoint(866, -330));
printers[i].PrintScaleToFit();

//Export to PDF
VectorDraw.Render.PrinterRender.ExportMultiPagePDF(new RenderFormats.PdfRender(), vdFramedC.BaseControl.ActiveDocument, printers, @"C:\testing\test1.pdf");

标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@capbkgr.cn

文章转载自:慧都控件

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP