Xamarin表单-如何在UWP中以PDF或JPEG格式存储图像

时间:2019-05-08 06:08:14

标签: c# xamarin.forms uwp win-universal-app uwp-xaml

朋友们,我正在开发DMS应用程序,用户可以在其中通过扫描仪扫描文档或图像并在服务器上上传。

出于扫描目的,我将此link推荐为效果很好..:)

现在的问题是ImageScanner.ScanFilesToFolderAsync(ImageScannerScanSource,StorageFolder),此方法接受扫描仪支持的图像格式。我的扫描仪仅支持.BMP格式,但是我想以给定的文件夹名称存储PDF或JPEG格式的图像。

其他,请提出任何免费的pdf软件包(dll)。哪些可以接受多种图像格式并转换为pdf格式以及uwp中的 PDFSharp 软件包支持?

提前谢谢:)

  ScannerSettings _ScannerSettings = new ScannerSettings();  

  ImageScanner scanner = await ImageScanner.FromIdAsync(_settings.DeviceId);

  scanner = _ScannerSettings.SetScannerSettings(scanner, _settings); // here i am trying to assigning the scanner settings with pdf or jpeg format.

 var operation =  scanner.ScanFilesToFolderAsync(AssignScannerType, folder); // it gives exception if i am passing the pdf or JPEG format in scanner settings because my scanner not support this format.

1 个答案:

答案 0 :(得分:2)

https://github.com/ststeiger/PdfSharpCore 是.NET Core 1.6+的端口 它不使用System.Drawing.dll。 它基于PdfSharp 1.32,并具有一些缺失和一些无法正常工作的功能。

https://github.com/ststeiger/PdfSharpNetStandard 适用于NetStandard 2.1+,并基于PdfSharp 1.5。

几乎没有什么东西 (https://github.com/ststeiger/PdfSharpNetStandard/tree/master/PdfSharp_Removed https://github.com/ststeiger/PdfSharpNetStandard/tree/master/MigraDoc_Rendering_Removed)。 PdfSharpNetStandard应该像PdfSharp一样工作。

PdfSharpCore已将PdfSharp更改为基于.NET-Core高性能实现。 从理论上讲,它应该具有更好/更高的性能。