Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
Dim instructions As IpfcPDFExportInstructions
Dim CoCreoSession As IpfcBaseSession
Dim outPath As String Try
Dim run As New pfcModelsExamples
asyncConnection = Casync.Connect(DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value)
CoCreoSession = asyncConnection.Session Dim descModel As IpfcModelDescriptor
descModel = (New CCpfcModelDescriptor).Create(EpfcModelType.EpfcMDL_DRAWING, Nothing, Nothing)
descModel.Path = "C:\Documents and Settings\Administrator\My Documents\drw0001.drw.1" 'Dim LmodDoc As IpfcModel = CoCreoSession.GetModelFromDescr(descModel)
Dim LmodDoc As IpfcModel = retrieveModelFromStdDir(CoCreoSession, EpfcModelType.EpfcMDL_DRAWING, "C:\Documents and Settings\Administrator\My Documents\drw0001.drw.1") If Not LmodDoc Is Nothing Then
LmodDoc.Display()
CoCreoSession.CurrentWindow.Activate()
End If instructions = (New CCpfcPDFExportInstructions).Create() outPath = "c:\work\" + LmodDoc.InstanceName.ToLower + ".pdf"
LmodDoc.Export(outPath, instructions)
If Not LmodDoc Is Nothing Then CoCreoSession.CurrentWindow.Close()
Catch ex As Exception
MsgBox(ex.Message & vbNewLine & ex.StackTrace)
End Try
End Sub Public Function retrieveModelFromStdDir(ByVal session As IpfcBaseSession, _
ByVal type As EpfcModelType, _
ByVal stdPath As String) As IpfcModel Dim descModel As IpfcModelDescriptor
Dim options As IpfcRetrieveModelOptions
Dim model As IpfcModel Try
'======================================================================
'Model is retrieved using a model descriptor object.
'This method loads the model identified by model type and path from a
'standard directory location.
'======================================================================
options = (New CCpfcRetrieveModelOptions).Create
options.AskUserAboutReps = False descModel = (New CCpfcModelDescriptor).Create(type, Nothing, Nothing)
descModel.Path = stdPath model = session.RetrieveModelWithOpts(descModel, options) retrieveModelFromStdDir = model Catch ex As Exception
MsgBox(ex.Message.ToString + Chr(13) + ex.StackTrace.ToString)
Return Nothing
End Try End Function

Proe 导出PDF Vb.net的更多相关文章

  1. Proe5.0导出PDF至配置文件的相关方法,VC++

    定义文件bcsMessage.txt PLM PLM PLM # login login 测试 # Active messagebox menu Active messagebox menu 激活菜单 ...

  2. .Net导出pdf文件,C#实现pdf导出

    最近碰见个需求需要实现导出pdf文件,上网查了下代码资料总结了以下代码.可以成功的实现导出pdf文件. 在编码前需要在网上下载个itextsharp.dll,此程序集是必备的.楼主下载的是5.0版本, ...

  3. JS导出PDF插件(支持中文、图片使用路径)

    在WEB上想做一个导出PDF的功能,发现jsPDF比较多人推荐,遗憾的是不支持中文,最后找到pdfmake,很好地解决了此问题.它的效果可以先到http://pdfmake.org/playgroun ...

  4. ITextSharp导出PDF表格和图片(C#)

    文章主要介绍使用ITextSharp导出PDF表格和图片的简单操作说明,以下为ITextSharp.dll下载链接 分享链接:http://pan.baidu.com/s/1nuc6glj 密码:3g ...

  5. JAVA导出pdf实例

    一.直接导出成PDF   Java代码 1. import java.io.FileNotFoundException; 2. import java.io.FileOutputStream; 3.  ...

  6. 利用ITextSharp导出PDF文件

    最近项目中需要到处PDF文件,最后上网搜索了一下,发现ITextSharp比较好用,所以做了一个例子: public string ExportPDF() { //ITextSharp Usage / ...

  7. iText导出pdf、word、图片

    一.前言 在企业的信息系统中,报表处理一直占比较重要的作用,本文将介绍一种生成PDF报表的Java组件--iText.通过在服务器端使用Jsp或JavaBean生成PDF报表,客户端采用超级连接显示或 ...

  8. Itext导出PDF,word,图片案例

    iText导出pdf.word.图片 一.前言 在企业的信息系统中,报表处理一直占比较重要的作用,本文将介绍一种生成PDF报表的Java组件--iText.通过在服务器端使用Jsp或JavaBean生 ...

  9. Ireport 报表导出 Poi + ireport 导出pdf, word ,excel ,htm

    Ireport 报表导出 Poi + ireport 导出pdf, doc ,excel ,html 格式 下面是报表导出工具类reportExportUtils 需要导出以上格式的报表 只需要调用本 ...

随机推荐

  1. 编程入门-Java开发工具介绍及Eclipse安装

    编程入门-Java开发工具介绍及Eclipse安装 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.Java开发工具介绍 "源代码"一般是文字,所以可以使用记 ...

  2. POJ 3627:Bookshelf

    Bookshelf Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7758   Accepted: 3906 Descrip ...

  3. Distributed--2PC和3PC

    参考 https://blog.csdn.net/lnho2015/article/details/78685503 https://www.cnblogs.com/hubaoxi/p/6867203 ...

  4. 【pwnable.kr】coin1

    pwnable从入门到放弃又一发 说是一道pwnable,其实是一道coding... nc pwnable.kr 9007 连接上看看,玩硬币? 老子是来拿flag的,谁来哄孩子来了!!! 算了,f ...

  5. 不同DIV滚动条如何同步?

    $(".DIV").scroll(function(){  $(".target").scrollLeft($(".DIV ").scrol ...

  6. 吴裕雄--天生自然C++语言学习笔记:C++ 变量类型

    变量其实只不过是程序可操作的存储区的名称.C++ 中每个变量都有指定的类型,类型决定了变量存储的大小和布局,该范围内的值都可以存储在内存中,运算符可应用于变量上. 变量的名称可以由字母.数字和下划线字 ...

  7. vue知识点散记

    1.iphone5微信浏览器里的methods里貌似不兼容  test(){} 写法,只支持test:function(){} 2.v-cloak 防止双括号的闪烁 <div id=" ...

  8. Python爬虫的简单入门(一)

    Python爬虫的简单入门(一) 简介 这一系列教学是基于Python的爬虫教学在此之前请确保你的电脑已经成功安装了Python(本教程使用的是Python3).爬虫想要学的精通是有点难度的,尤其是遇 ...

  9. axios基础介绍

    axios基础介绍 get请求要在params中定义,post要在data中定义.

  10. Arduino Wireless Communication – NRF24L01 Tutorial(arduino无线通信---NRF24L01教程)

    arduino下nrf24l01库文件及相关说明 库的说明文档 https://tmrh20.github.io/RF24/ 库的源代码github下载页面 https://tmrh20.github ...