当前位置:网站首页>C# 将OFD转为PDF
C# 将OFD转为PDF
2022-06-11 11:33:00 【Eiceblue】
OFD格式的文档是一种我国独有的国家标准版式的文档,在不同场景需求中,可以通过格式转换的方法将PDF转为OFD,或者将OFD转为PDF。本次内容,将通过C#程序介绍如何实现由OFD到PDF的转换,并附上VB.NET代码供参考。下面是具体方法和步骤。
一、按照如下步骤引入Spire.Pdf.dll
步骤1:在Visual Studio中打开“解决方案资源管理器”- 鼠标右键点击“引用”-“管理NuGet包”。

步骤2:选择“浏览”-在搜索框中输入搜索内容,选择搜索结果,点击“安装”。

步骤3:依次点击“OK”-"接受",然后等待程序完成安装。
或者,可以通过官网下载 Spire.PDF for .NET,解压,然后手动将BIN文件夹下的dll文件引入至程序。
二、代码示例
转换时,只需要通过两行代码实现,即:
C#
using Spire.Pdf.Conversion;
namespace OFDtoPDF
{
class Program
{
static void Main(string[] args)
{
//加载OFD文档
OfdConverter converter = new OfdConverter("test.ofd");
//转为PDF格式保存
converter.ToPdf("ToPDF.pdf");
}
}
}
VB.NET
Imports Spire.Pdf.Conversion
Namespace OFDtoPDF
Class Program
Private Shared Sub Main(args As String())
'加载OFD文档
Dim converter As New OfdConverter("test.ofd")
'转为PDF格式保存
converter.ToPdf("ToPDF.pdf")
End Sub
End Class
End Namespace
转换结果:

—End—
边栏推荐
- nft数字藏品系统开发搭建流程
- Where is it safer to open an account for soda ash futures? How much does it cost to buy soda ash futures?
- 广东市政安全施工资料管理软件2022新表格来啦
- Runtime reconfiguration of etcd
- CVPR 2022 | 文本引导的实体级别图像操作ManiTrans
- 导师转我800块,让我仿真一个电路(电源设计)
- js合并两个对象(面试题)
- JS interview questions - arrow function, find and filter some and every
- The no category parents plug-in helps you remove the category prefix from the category link
- Publish WordPress database cache plug-in: DB cache reloaded 3.1
猜你喜欢

Liufan, CFO of papaya mobile, unleashes women's innovative power in the digital age

It will be too late if you don't brush the questions. The most complete bat interview questions

Template engine - thymeleaf

Jest unit test description config json
![Définir l'adresse de réception par défaut [Centre commercial du projet]](/img/eb/2864b124b66d01849315a367948ed4.png)
Définir l'adresse de réception par défaut [Centre commercial du projet]

01_ Description object_ Class diagram

National multi-year solar radiation spatial distribution data 1981-2022, temperature distribution data, evapotranspiration data, evaporation data, rainfall distribution data, sunshine data, wind speed

浙大联合微软亚研院发布视频识别新方法,可对视频逐帧识别且无需,数据标记,或可用于手语翻译等

The role of Gerber file in PCB manufacturing

Problems encountered when using nailing intranet to penetrate and upload PHP projects
随机推荐
全国多年太阳辐射空间分布数据1981-2022年、气温分布数据、蒸散量数据、蒸发量数据、降雨量分布数据、日照数据、风速数据
Template engine - thymeleaf
让WordPress支持注册用户上传自定义头像功能
MSF CS OpenSSL traffic encryption
Centos7.x下安装mysql8遇到的问题Couldn‘t open file /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022
Jest unit test description config json
统计出现次数最多的前K个字符串
CVPR 2022 | 文本引导的实体级别图像操作ManiTrans
arguments.callee 实现函数递归调用
Zhejiang University and Microsoft Asia Research Institute released a new method of video recognition, which can recognize video frame by frame without data marking, or can be used for sign language tr
AcWing 1353. Ski resort design (greedy)
[issue 30] shopee golang development experience
再不刷题就晚了,最全的BAT大厂面试题整理
【Go】Gin源码解读
WordPress database cache plug-in: DB cache Reloaded
Etcd的运行时重配置
WordPress regenerate featured image plugin: regenerate thumbnails
NFT digital collection app system construction
iframe 传值
Split data - horizontal split and vertical split