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

通江县住房和城乡建设局网站广东seo

通江县住房和城乡建设局网站,广东seo,正规建筑工程网站,情侣视频被4万人围观1.NuGet 安装 O2S.Components.PDFView4NET.WPF 2.添加组件 工具箱中&#xff0c;空白处 右键&#xff0c;选择项 WPF组件 界面&#xff0c;选择NuGet安装库对面路径下的 O2S.Components.PDFView4NET.WPF.dll 3.引入组件命名空间&#xff0c;并使用 <Windowxmlns"htt…

1.NuGet 安装 O2S.Components.PDFView4NET.WPF

2.添加组件

工具箱中,空白处 右键,选择项

WPF组件 界面,选择NuGet安装库对面路径下的  O2S.Components.PDFView4NET.WPF.dll

3.引入组件命名空间,并使用

<Windowxmlns="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:PDFView"xmlns:PageViewWPF="clr-namespace:O2S.Components.PDFView4NET.WPF;assembly=O2S.Components.PDFView4NET.WPF"x:Class="PDFView.MainWindow"mc:Ignorable="d"Title="MainWindow" Height="450" Width="800" Loaded="Window_Loaded"><Grid><Grid.ColumnDefinitions><ColumnDefinition/></Grid.ColumnDefinitions><PageViewWPF:PDFPageView x:Name="PdfControl" HorizontalAlignment="Left" Height="auto" VerticalAlignment="Top" Width="auto" PageDisplayLayout="Custom"  WorkMode="PanAndScan" HighlightFormFields="True"/></Grid>
</Window>
using O2S.Components.PDFView4NET;
using System.Windows;namespace PDFView
{/// <summary>/// MainWindow.xaml 的交互逻辑/// </summary>public partial class MainWindow : Window{public MainWindow(){InitializeComponent();}private void Window_Loaded(object sender, RoutedEventArgs e){PdfControl.Document = new PDFDocument() { FilePath = ".\\4.pdf" };}}
}

4.PDF转换成图片

听说有破解版(无水印),找到了两个版本两个不同O2S.Components.PDFRender4NET破解版

百度网盘地址:链接:https://pan.baidu.com/s/1onJG6pkmXAR-pT1ZzeIy4A 
提取码:dlfe

版本2.0.1.0 对于我的测试PDF,使用正常

版本4.5.1.2 对于我的测试PDF,使用异常

PdfToImage(".\\4.pdf", Environment.CurrentDirectory, "4", ImageFormat.Png, Definition.Eight);
/// <summary>/// PDF文档所有页全部转换为图片/// </summary>/// <param name="pdfInputPath">PDF文件流</param>/// <param name="imageOutputPath">图片输出路径</param>/// <param name="imageName">生成图片的名字</param>/// <param name="imageFormat">设置所需图片格式</param>/// <param name="definition">设置图片的清晰度,数字越大越清晰</param>public static void PdfToImage(string pdfStream, string imageOutputPath, string imageName, ImageFormat imageFormat, Definition definition){PDFFile pdfFile = PDFFile.Open(pdfStream);int startPageNum = 1;int endPageNum = pdfFile.PageCount;for (int i = startPageNum; i <= endPageNum; i++){try{Bitmap pageImage = pdfFile.GetPageImage(i - 1, 56 * (int)definition);int canKao = pageImage.Width > pageImage.Height ? pageImage.Height : pageImage.Width;int newHeight = canKao > 1080 ? pageImage.Height / 2 : pageImage.Height;int newWidth = canKao > 1080 ? pageImage.Width / 2 : pageImage.Width;Bitmap newPageImage = new Bitmap(newWidth, newHeight);Graphics g = Graphics.FromImage(newPageImage);g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;g.DrawImage(pageImage, new Rectangle(0, 0, newWidth, newHeight),new Rectangle(0, 0, pageImage.Width, pageImage.Height), GraphicsUnit.Pixel);newPageImage.Save(imageOutputPath + imageName + (endPageNum >= 2 ? ("-" + i) : "") + "." + imageFormat);//+ i.ToString() imageFormatg.Dispose();newPageImage.Dispose();pageImage.Dispose();}catch (Exception ex){string ss = ex.ToString();}}pdfFile.Dispose();}/// <summary>/// 转换的图片清晰度,1最不清醒,10最清晰/// </summary>public enum Definition{One = 1, Two = 2, Three = 3, Four = 4, Five = 5, Six = 6, Seven = 7, Eight = 8, Nine = 9, Ten = 10}

5.附上官方代码库链接

PDFView4NET https://github.com/o2solutions/pdfview4net/tree/main

http://www.hkea.cn/news/191571/

相关文章:

  • 建设局网站上开工日期选不了制作网站需要多少费用
  • 犬舍网站怎么做网页推广怎么做
  • 镇江核酸检测最新通知如何优化网页加载速度
  • wpf入可以做网站吗竞价托管外包费用
  • 公司设计网站需要包含什么资料优化排名软件
  • 日本樱花云服务器wan亚马逊seo关键词优化软件
  • layui框架的wordpress厦门站长优化工具
  • 微网站设计尺寸培训课程总结
  • 保险平台官网湖北搜索引擎优化
  • 西安微信小程序制作公司关键词优化方法
  • 手机网站建设用乐云seo搜索引擎是什么意思啊
  • 昆明做大的网站开发公司google网页搜索
  • 做网站运营需要什么证宁波靠谱营销型网站建设
  • 天津进口网站建设电话青岛网站建设公司
  • 游戏币网站建设win7优化大师官方网站
  • 技术专业网站建设班级优化大师网页版登录
  • 外国网站上做雅思考试台州百度推广优化
  • 男女做那种的的视频网站国内最好的搜索引擎
  • 泉州做网站优化价格成功品牌策划案例
  • 做网站去哪个平台资源优化排名网站
  • 备案的网站名称可以改吗百度青岛代理公司
  • 专做进口批发的网站关键词优化多少钱
  • 做网站有了空间在备案吗百度权重高的网站有哪些
  • 做空间的网站著名的网络营销案例
  • 做网站客户尾款老不给怎么办百度推广年费多少钱
  • 想要将网站信息插到文本链接怎么做百度关键词搜索
  • 江苏网站备案要多久seo域名综合查询
  • 大型网站建设机构津seo快速排名
  • 建设证件查询官方网站宁波做网站的公司
  • 那些网站招聘在家里做的客服网店推广策略