www.mxdraw.com
|
导出pdf文件
static BOOL Mx_ExprotPdf(CString sPdfFileName, double dPaperH = 210, double dPaperW = 297, LPCTSTR pszTitle = NULL, BOOL isExportLayout = FALSE, BOOL isBlackWhite = FALSE);
参数 |
说明 |
CString sPdfFileName |
pdf文件路径 |
double dPaperH = 210 |
Pdf的图纸高度,该值越大,pdf文件越大,分辨率越高 |
double dPaperW = 297 |
Pdf的图纸宽度,该值越大,pdf文件越大,分辨率越高 |
LPCTSTR pszTitle = NULL |
Pdf文件的标题。 |
BOOL isExportLayout = FALSE |
是否同时导出DWG图纸的布局页面。 |
BOOL isBlackWhite = FALSE |
是否把颜色变成黑白色,再输出. |
iCountLayout |
布局数组长度 LayoutName.. -布局数组的布局名 |
成功返回TRUE
例如: VB代码
Dim param As MxDrawResbuf Set param = New MxDrawResbuf param.AddString "c:1.pdf" param.AddDouble 1000 param.AddDouble 1000 param.AddString "Title" MxDrawX1.CallEx "Mx_ExprotPdf", param
例如: JAVA代码.
ActiveXComponent smsg1 = new ActiveXComponent("MxDrawX.MxDrawService"); // 获取Active对象 Dispatch msg1 = smsg1.getObject(); // 调用组件方法,打开指定dwg文件 msg1.call(msg1, "Open", "D:/temp/ife/1.dwg"); //msg1.call(msg1, "SaveDwgFile", "D:/temp/ife/1test.pdf"); ActiveXComponent smsg = new ActiveXComponent("MxDrawX.MxDrawApplication"); Dispatch msg = smsg.getObject(); ActiveXComponent paramCom = new ActiveXComponent("MxDrawX.MxDrawResbuf"); Dispatch param3 = paramCom.getObject(); param3.call(param3,"AddString","d:/temp/1test.pdf"); param3.call(param3,"AddDouble",2000); param3.call(param3,"AddDouble",2000); param3.call(param3,"AddString","ife"); param3.call(param3,"AddLong",1); param3.call(param3,"AddLong",0); Object[] params4 = new Object[] {"Mx_ExportPdf",param3}; Dispatch result = msg.call(msg,"CallEx",params4).toDispatch(); Variant aaa=result.call(result, "AtString",0); System.out.println("done. "+aaa); smsg.safeRelease(); msg1.call(msg1, "Close"); smsg1.safeRelease(); paramCom.safeRelease();
例如: C#代码.
MxDrawResbuf param = new MxDrawResbuf();
param.AddString ("F:\1.pdf");
param.AddDouble (1000);
param.AddDouble (1000);
param.AddString ("Title");
param.AddLong (1);
param.AddLong (1);
param.AddLong(3);
param.AddString("bb");
param.AddString("cc");
param.AddString("aa");
axMxDrawX1.CallEx("Mx_ExprotPdf", param);