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. POJ - 3349 Snowflake Snow Snowflakes (哈希)

    题意:给定n(0 < n ≤ 100000)个雪花,每个雪花有6个花瓣(花瓣具有一定的长度),问是否存在两个相同的雪花.若两个雪花以某个花瓣为起点顺时针或逆时针各花瓣长度依次相同,则认为两花瓣相 ...

  2. PHP - 接收检验验证码 , 以JSON的形式将验证结果返回给前端

    <?php session_start(); $codeT = strtoupper(trim($_POST['codeT']));//接收前端传来的数据,转换成大写          $raw ...

  3. CSS - 导入Google Web 字体

    @import url('http://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900'); b ...

  4. MySLQ排序后标记排行

    查询排行及所有(表名.*) 1. ; AS top, customer.* FROM customer 2. AS top, customer.* ) r, customer ORDER BY cus ...

  5. list的泛型

    更新记录 [1]2020.02.12-21:26 1.完善内容 正文 在学习list集合时,我看到书上写list的格式时 List<E> list = new ArrayList<& ...

  6. bugku-杂项 听首音乐

    下载文件,是个wav文件,用Audacity打开,发现有 放大后记录下来:(每一组后面加上空格) ..... -... -.-. ----. ..--- ..... -.... ....- ----. ...

  7. POJ 1745:Divisibility 枚举某一状态的DP

    Divisibility Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 11001   Accepted: 3933 Des ...

  8. POJ 1006:Biorhythms 中国剩余定理

    Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 121194   Accepted: 38157 Des ...

  9. 剑指offer第40题

    package com.yan.offer; /** * 题目描述: * * 一个整型数组里除了两个数字之外,其他的数字都出现了两次.请写程序找出这两个只出现一次的数字. * * @author Ya ...

  10. VMware-Workstation-Full-12.5.9

    https://download3.vmware.com/software/wkst/file/VMware-Workstation-Full-12.5.9-7535481.x86_64.bundle ...