CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ObjectARX 开发指南

相关分类

打印到文件

2023-1-1 01:43| 发布者: admin| 查看: 453| 评论: 0|来自: AutoCAD

应用程序可以通过调用参数设置为 true 并包含完全限定的文件名来将文档设置为打印到文件。为了打印到文件,所选设备必须支持该功能。AcPlPlotEngine::beginDocument()bPlotToFilepFileName

以下代码显示了打印到文件的过程,为清楚起见,省略了打印进度对话框代码:

AcPlPlotEngine* pEngine = NULL;
if(Acad::eOk==AcPlPlotFactory::createPublishEngine(pEngine))
{
    ...
    es = pEngine->beginPlot(pPlotProgDlg);
    AcPlPlotPageInfo pageInfo;
    AcPlPlotInfo plotInfo; 
    plotInfo.setLayout(layoutId);
    AcPlPlotInfoValidator validator;
    es = validator.validate(plotInfo);
    const char *szDocName=acDocManager->curDocument()->fileName();
    // Set bPlotToFile parameter to true.
    es = pEngine->beginDocument(plotInfo, szDocName, 
            NULL, 1, true, m_csFilename);
    es = pEngine->beginPage(pageInfo, plotInfo, true);
    es = pEngine->beginGenerateGraphics();
    es = pEngine->endGenerateGraphics();
    es = pEngine->endPage();
    es = pEngine->endDocument();
    es = pEngine->endPlot();
    // Destroy the engine. 
    pEngine->destroy();
    pEngine = NULL;
else
    // Ensure the engine is not already busy...
    AfxMessageBox("Plot Engine is Busy...");
}

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-28 02:03

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部