应用程序可以通过调用参数设置为 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..."); } |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:20
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.