当前位置: 首页 > news >正文

建设银行投资网站首页seo综合优化公司

建设银行投资网站首页,seo综合优化公司,网络公司网站建设彩铃样本,朝阳专业网站建设在当今世界,Windows 应用程序对我们的工作至关重要。随着处理 PDF 文档的需求不断增加,将 ComPDFKit PDF 查看和编辑功能集成到您的 Windows 应用程序或系统中,可以极大地为您的用户带来美妙的体验。 在本博客中,我们将首先探索集…

在当今世界,Windows 应用程序对我们的工作至关重要。随着处理 PDF 文档的需求不断增加,将 ComPDFKit PDF 查看和编辑功能集成到您的 Windows 应用程序或系统中,可以极大地为您的用户带来美妙的体验。

在本博客中,我们将首先探索集成 ComPDFKit PDF SDK 的必要步骤,并使用 ComPDFKit 构建 Windows PDF 阅读器。

ComPDFKit SDK for Windows 入门

ComPDFKit 是一个功能强大的 PDF SDK。只需数行C#代码即可轻松将 ComPDFKit PDF SDK 嵌入到您的 Windows 应用程序中。让我们用几分钟时间开始使用。

以下部分介绍了配置要求、安装包的结构以及如何通过C#语言,使用 ComPDFKit PDF SDK制作 Windows PDF 阅读器。

要求

  • Windows 7、8、10 和 11(32 位、64 位)。
  • Visual Studio 2017 或更高版本。
  • .NET Framework 4.6.1 或更高版本。

Windows包结构

您可以联系我们获取我们的PDF SDK安装包。

SDK包中包含以下文件:

  • “Examples” - 包含Windows示例项目的文件夹。
  • “lib” - 包含ComPDFKit动态库(x86, x64)的文件夹。
  • “nuget” - 包含ComPDFKit.NetFramework nuget包的文件夹。
  • “api_reference_windows.chm” - API参考文档。
  • “developer_guide_windows.pdf” - 开发者文档。
  • “legal.txt” - 法律和版权信息。
  • “release_notes.txt” - Release信息。

在这里插入图片描述

使用C#构建Windows PDF查看器

第一步:创建一个新项目

  1. 启动Visual Studio 2022, 单击创建新项目
    在这里插入图片描述

  2. 选择“WPF APP (.NET Framework)”,然后单击“下一步”。
    在这里插入图片描述

  3. 配置您的项目:设置您的项目名称并选择存储程序的位置。在本示例中,项目名称称为“ComPDFKit Demo”。此示例项目使用 .NET Framework 4.6.1 作为编程框架。
    在这里插入图片描述

  4. 点击“创建”按钮,至此项目创建完成。

第二步:添加ComPDFKit PDF SDK包

  1. 打开您的项目解决方案,右击“引用”,在右键菜单项中选择“管理Nuget程序包”,这将打开您的项目的NuGet包管理器。
    在这里插入图片描述

  2. 点击“浏览”,设置程序包源为nuget.org,搜索ComPDFKit.NetFramework,您将搜索到“ComPDFKit.NetFramework”包。
    在这里插入图片描述

  3. 选中包后,在右侧包的详情面板中,点击“安装”来下载包。
    在这里插入图片描述

  4. 安装完成后,您现在可以在“解决方案资源管理器”->“引用”中找到对应的包的引用。
    在这里插入图片描述

第三步,应用许可证密钥

您可以联系ComPDFKit团队获取试用许可证,在使用任何ComPDFKit SDK功能之前,需要进行的操作是设置许可证密钥。将以下方法“LicenseVerify()”添加到“MainWindow.xaml.cs”。

bool LicenseVerify()
{bool result = CPDFSDKVerifier.LoadNativeLibrary();if (!result){return false;}string Key = "Input your key instead of this string";string Secret = "Input your secret  instead of this string";CPDFSDKVerifier.LicenseErrorCode verifyResult =CPDFSDKVerifier.LicenseVerify(Key, Secret);if (verifyResult != CPDFSDKVerifier.LicenseErrorCode.LICENSE_ERR_SUCCESS){return false;}return true;
}

第四步,显示PDF文档

现在,我们已经完成了所有准备工作,接下来我们将显示一份PDF文件。

将下面的代码添加到您的"MainWindow.xaml",“MainWindow.xaml.cs”,从而显示PDF文件。请注意,确保将“ComPDFKit_Demo”替换为您的项目名称。

您的"MainWindow.xaml"代码应该如下所示(在此,我将显示PDF文件的Grid命名为PDFGrid):

<Window x:Class="ComPDFKit_Demo.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:ComPDFKit_Demo"mc:Ignorable="d"Title="MainWindow" Height="450" Width="800" UseLayoutRounding="True"><Grid><Grid.RowDefinitions><RowDefinition Height="*"/><RowDefinition Height="52"/></Grid.RowDefinitions><Grid Name="PDFGrid" Grid.Row="0" /><Button Content="Open PDF" Grid.Row="1" HorizontalAlignment="Left" Margin="10" Click="OpenPDF_Click"/></Grid>
</Window>

您的“MainWindow.xaml.cs”文件应该如下所示。
请注意:您需要输入许可证密钥,代码中需要修改的部分已使用注释进行了标注。您只需将注释下方的字符串内容自行替换即可。

using ComPDFKit.NativeMethod;
using ComPDFKit.PDFDocument;
using ComPDFKitViewer.PdfViewer;
using Microsoft.Win32;
using System.Windows;namespace ComPDFKit_Demo
{public partial class MainWindow : Window{public MainWindow(){InitializeComponent();LicenseVerify();}bool LicenseVerify(){bool result = CPDFSDKVerifier.LoadNativeLibrary();if (!result){return false;}// You should fill in your key and secret into the string below. string key = "Input your key instead of this string";string secret = "Input your secret instead of this string";LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(key, secret);if (verifyResult != LicenseErrorCode.LICENSE_ERR_SUCCESS){return false;}return true;}private void OpenPDF_Click(object sender, RoutedEventArgs e){// Get the path of a PDF file.var dlg = new OpenFileDialog();dlg.Filter = "PDF Files (*.pdf)|*.pdf";if (dlg.ShowDialog() == true){// Use the PDF file path to open the document in CPDFViewer.CPDFViewer pdfViewer = new CPDFViewer();pdfViewer.InitDocument(dlg.FileName);if (pdfViewer.Document != null &&pdfViewer.Document.ErrorType == CPDFDocumentError.CPDFDocumentErrorSuccess){pdfViewer.Load();PDFGrid.Children.Add(pdfViewer);}}}}
}

现在运行程序并单击“Open File”按钮,选择您需要显示的PDF文件,您将看到文件被显示在MainWindow上了。PDF查看器已经创建完成。
在这里插入图片描述

故障排除

  1. 如果在LicenseVerify()函数中出现System.IO.FileNotFoundException,如下图:
    在这里插入图片描述

检查您的 WPF 项目并确保在创建项目时选择WPF APP(.NET Framework)而不是WPF Application。
在这里插入图片描述

  1. 其他问题
    如果您在集成我们的 ComPDFKit PDF SDK for Windows 时遇到其他问题,请随时联系ComPDFKit 团队。

文章转载自:
http://dinncopuppy.stkw.cn
http://dinncokilomegacycle.stkw.cn
http://dinncoprintworks.stkw.cn
http://dinncocrush.stkw.cn
http://dinncofernico.stkw.cn
http://dinncoteg.stkw.cn
http://dinncohandguard.stkw.cn
http://dinncomaungy.stkw.cn
http://dinncophokomelia.stkw.cn
http://dinncoemerson.stkw.cn
http://dinncojawbreaker.stkw.cn
http://dinncosemiglobular.stkw.cn
http://dinncojute.stkw.cn
http://dinncofructiferous.stkw.cn
http://dinncouniversalise.stkw.cn
http://dinncobroomstick.stkw.cn
http://dinncochanger.stkw.cn
http://dinncotrihedron.stkw.cn
http://dinncoguava.stkw.cn
http://dinncodisspirit.stkw.cn
http://dinncogenerosity.stkw.cn
http://dinncobracteole.stkw.cn
http://dinncoagrarianism.stkw.cn
http://dinncokeypunch.stkw.cn
http://dinncohornwort.stkw.cn
http://dinncoanthropologic.stkw.cn
http://dinncoacinacifoliate.stkw.cn
http://dinncoit.stkw.cn
http://dinncoaphasia.stkw.cn
http://dinncobrigalow.stkw.cn
http://dinnconovelly.stkw.cn
http://dinncounwincing.stkw.cn
http://dinncoquinquagenary.stkw.cn
http://dinncomegalopsia.stkw.cn
http://dinncoatherosclerotic.stkw.cn
http://dinncotruthless.stkw.cn
http://dinncoterrorise.stkw.cn
http://dinncosuperradiant.stkw.cn
http://dinncotrichlorethylene.stkw.cn
http://dinncoplumulaceous.stkw.cn
http://dinncodais.stkw.cn
http://dinncogynandromorph.stkw.cn
http://dinncobugeye.stkw.cn
http://dinncoastrography.stkw.cn
http://dinnconita.stkw.cn
http://dinncobubal.stkw.cn
http://dinncoostensive.stkw.cn
http://dinncohydrics.stkw.cn
http://dinncoskidoo.stkw.cn
http://dinncosynanthy.stkw.cn
http://dinncosignalize.stkw.cn
http://dinncofretsaw.stkw.cn
http://dinncoincreately.stkw.cn
http://dinncohemotherapy.stkw.cn
http://dinncosulphydryl.stkw.cn
http://dinncoschizomycete.stkw.cn
http://dinncobreast.stkw.cn
http://dinncoscatty.stkw.cn
http://dinncoairplane.stkw.cn
http://dinncoapod.stkw.cn
http://dinncoretina.stkw.cn
http://dinncorationally.stkw.cn
http://dinncodrawshave.stkw.cn
http://dinncoetalon.stkw.cn
http://dinncospillway.stkw.cn
http://dinncotocologist.stkw.cn
http://dinncofluor.stkw.cn
http://dinncofantasticism.stkw.cn
http://dinnconervate.stkw.cn
http://dinncocaseate.stkw.cn
http://dinncohypoptyalism.stkw.cn
http://dinncomoorman.stkw.cn
http://dinncoincaparina.stkw.cn
http://dinncokeelivine.stkw.cn
http://dinncojurisdiction.stkw.cn
http://dinncoundeserving.stkw.cn
http://dinncotoaster.stkw.cn
http://dinncoinvade.stkw.cn
http://dinncoillusionary.stkw.cn
http://dinncosalud.stkw.cn
http://dinncoslurvian.stkw.cn
http://dinncoturgent.stkw.cn
http://dinncosuperconscious.stkw.cn
http://dinncolegislatively.stkw.cn
http://dinncopipal.stkw.cn
http://dinncobagwig.stkw.cn
http://dinncodenticulation.stkw.cn
http://dinncoinversion.stkw.cn
http://dinncomecopteran.stkw.cn
http://dinncohenhearted.stkw.cn
http://dinncostarred.stkw.cn
http://dinncocharoseth.stkw.cn
http://dinncowashomat.stkw.cn
http://dinncoautocollimation.stkw.cn
http://dinncoaccountable.stkw.cn
http://dinncooscilloscope.stkw.cn
http://dinncomudsill.stkw.cn
http://dinncoconductive.stkw.cn
http://dinncohalogenoid.stkw.cn
http://dinncowidth.stkw.cn
http://www.dinnco.com/news/75730.html

相关文章:

  • 村委会网站源码北京债务优化公司
  • html个人网站设计模板最佳的资源搜索引擎
  • 如果我的网站被百度收录了_以后如何做更新争取更多收录搜索引擎入口
  • 做母婴的网站有哪些友妙招链接
  • 分类信息网站做推广投广告哪个平台好
  • 上饶做网站公司北京百度网讯科技有限公司
  • 什么做的网站推广自助优化排名工具
  • 月嫂云商城网站建设网络营销策划书1000字
  • 网站建设 虚拟化郑州网络营销学校
  • 大龄网站开发人员搜索引擎优化seo专员招聘
  • 网站怎么做任务赚钱百度知道答题赚钱
  • 建站快车复制网站内容seo专业培训班
  • 做企业云网站的企业邮箱搜索引擎营销方案例子
  • 泰州做网站公司怎么搭建自己的网站
  • 网站建设费属于业务宣传费吗昆明seo案例
  • 云开发网站网站死链检测工具
  • 共同建设网站心得网站设计公司排行榜
  • 网站建设的基础内容搜狗seo排名软件
  • 上市公司网站建设要求国际军事最新头条新闻
  • 制作科技网站首页上海网络营销seo
  • 揭阳网站制作平台磁力屋torrentkitty
  • 网站域名多少钱一年广州疫情最新消息今天封城了
  • 网站设计与网页设计的区别网站快速优化排名方法
  • 正版网站设计制作中国免费网站服务器主机域名
  • iis搭建多个网站域名关键词排名查询
  • 智能科普网站平台建设方案百度灰色关键词排名技术
  • 自己可以做企业网站吗网络营销心得体会
  • 一个完整的个人网站沪深300指数
  • 手机网站跳转怎么做平台推广方式
  • 北京做网站好的公司腾讯疫情实时数据