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. P 1029 旧键盘

    转跳点:

  2. tx2的一些系统命令

    查看TX2 ubuntu系统版本命令:https://blog.csdn.net/zhengxiangwen/article/details/60324802 sudo uname --m

  3. my97datepicker实现日期改变立刻触发函数

    <input type="text" class="Wdate" onclick="WdatePicker({onpicking:functio ...

  4. Canvas绘制水波进度加载

    效果: 用到图片下载: 自定义View: package com.czm.mysinkingview; import android.content.Context; import android.g ...

  5. windows elasticsearch-head插件安装教程

    elasticsearch-head下载地址:https://github.com/mobz/elasticsearch-head 1.git下载 git clone git://github.com ...

  6. 浅谈__slots__

    __slots__在python中是扮演属性声明(Attribute Declaration)的角色,当然属性本身不用声明,只需要在使用前赋值即可,但是实际上,属性的应用远非在使用前赋值就行,所以有a ...

  7. 一、VIP课程:互联网工程专题 01-Git基本概念与核心命令掌握

    第一课:Git基本概念与核心命令掌握.docx 课程概要: GIT 体系概述 GIT 核心命令使用 GIT 底层原理 一.GIT体系概述 1.使用方式区别 从本地把文件推送远程服务,SVN只需要com ...

  8. 浅谈无参数RCE

    0x00 前言 这几天做了几道无参数RCE的题目,这里来总结一下,以后忘了也方便再捡起来. 首先先来解释一下什么是无参数RCE: 形式: if(';' === preg_replace('/[^\W] ...

  9. 洛谷 P1964 【mc生存】卖东西(多重背包)

    题目传送门 解题思路: 题目里有,多重背包. AC代码: #include<iostream> #include<cstdio> #include<map> usi ...

  10. ref与out区别

    ref与out   out.ref都是传递引用(内存地址),使用后都将改变原来参数的数值.   ref 当调用方法时,在方法中会对ref传入的参数数值进行改变,若使用ref参数,则方法定义和调用方法都 ...