Xamarin Form - How To store an image in PDF or JPE

2020-02-26 11:50发布

问题:

hello friends i am developing the DMS application in which user can scan the document or images through scanner and upload on server.

For scanning purpose i am refered this link it works perfectly..:)

Now problem is ImageScanner.ScanFilesToFolderAsync(ImageScannerScanSource, StorageFolder) this Method accepts the image format which is supported by scanner. my scanner only support the .BMP format but i want to store an image in PDF or JPEG Format in given folder name.

Else please suggest any free pdf package( dll). which accept multiple image format and convert to single pdf format and PDFSharp package support in uwp ?

thanks in advance :)

  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:

https://github.com/ststeiger/PdfSharpCore is a port for .NET Core 1.6+ It doesn't use System.Drawing.dll. It is based on PdfSharp 1.32 and has some missing and some half-working features.

https://github.com/ststeiger/PdfSharpNetStandard Is for NetStandard 2.1+, and is based on PdfSharp 1.5.

Very few things are missing (https://github.com/ststeiger/PdfSharpNetStandard/tree/master/PdfSharp_Removed https://github.com/ststeiger/PdfSharpNetStandard/tree/master/MigraDoc_Rendering_Removed). PdfSharpNetStandard should work work just like PdfSharp.

PdfSharpCore has changed PdfSharp to be based on the .NET-Core High-Performance implementations. It should have a better/higher performance - in theory.