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. SpringBoot的ApplicationRunner和CommandLineRunner

    如果你需要在你的SpringBoot启动完成之后实现一些功能,那么可以通过创建class实现ApplicationRunner和CommandLineRunner来完成: @Component pub ...

  2. HDU 1576:A/B

    A/B Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submis ...

  3. 微服务中一个项目install打包总是失败

    在微服务的一个项目中install打包时总是报错如下: [INFO] Scanning for projects... [INFO] [INFO] -------------------------- ...

  4. CF 767#

    A题的话,用一个priority_queue维护一下,直到最大的符合要求才出来,,(一开始记错了,,2333写成了小根堆...) #include<bits/stdc++.h> #defi ...

  5. java课程课后作业190612之Beta版总结会议

    1.每个成员在beta 阶段的实践和alpha 阶段有何改进? 陈阳:在编程的时候学习广播知识,了解了Android的广播机制完成了上课静音以及课前提醒的功能,在代码的美观上也有了一定的提升 2. 团 ...

  6. Essay写作常见问题解析

    Essay是西方大学的主要考核形式之一.其理念是考核学生对资料信息的吸取和观点的输出能力.可是对于刚踏入美国大学的国际留学生来说,写Essay就像是一种水土不服.各种不适和挣扎是不可避免的!今天小编来 ...

  7. 常用sql语句(mysql测试)

    DB数据库,DatabaseDBMS数据库管理系统,DatabaMemanagmentSystemSQL结构化查询语言,structure Query Language 开启服务net start m ...

  8. LeetCode刷题笔记(1-9)

    LeetCode1-9 本文更多是作为一个习题笔记,没有太多讲解 1.两数之和 题目请点击链接 ↑ 最先想到暴力解法,直接双循环,但是这样复杂度为n平方 public int[] twoSum(int ...

  9. Notepad++配置

    笔记来源于视频: http://baidu.iqiyi.com/watch/498601896985630918.html?page=videoMultiNeed notepad++ 有个很重要问题, ...

  10. Kettle无法下载以及点击无反应的问题

    最开始用于解决MySQL转移数据到ORACLE的问题,尝试了几种方法. 1.直接从Mysql导出csv文件.这种方式最直接简单,但是问题是数据大的话,容易出现数据对不齐的情况,导入这个时候就会出现错误 ...