Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Oct 11, 2019 7:25 am

Hi All,
My company has just purchased a license of Spire.PDF (KiteEdge).

Our scenario is as follows.
Console EXE (.NET Core or .NET Framework)
---------------
|
|-------Plugin1.dll
|
|-------Plugin2.dll
|
|-------Plugin3.dll
|
|
|-------WatermarkPlugin.dl (using Spire.PDF)

Our EXE is designed to load various plugin assemblies using Assembly.LoadFrom. Each of these plugin assemblies along with their dependencies reside in their own folders.
The plugin assemblies are compiled on .NET Standard 2.0.One such plugin is a WaterMark plugin which calls the Spire.PDF to do the watermark.
We are using the CopyLocalLockFileAssemblies attribute in the CSPROJ to copy over all the dependencies to the output folder of the class library. Please note that the EXE has no knowledge of the plugin dependencies. The EXE has no compile time references to Spire.Pdf.

When WaterMark plugin is compiled using .NET Framework
Everything works fine. We find the folders x86 and x64 getting created and

When WaterMark plugin is compiled using .NET Standard 2.0
The executable throws the error :

Code: Select all
'libSkiaSharp': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at SkiaSharp.SkiaApi.sk_path_new()
   at SkiaSharp.SKPath..ctor()
   at sprᡑ..ctor()
   at sprᨀ..ctor()
   at Spire.Pdf.PdfPageBase..ctor(sprᣛ A_0, sprᥙ A_1)
   at Spire.Pdf.PdfPageWidget..ctor(PdfDocumentBase A_0, sprᥙ A_1, sprᣛ A_2)
   at Spire.Pdf.Widget.PdfPageCollection.ᜄ(sprᣛ A_0)
   at sprᥙ.ᜀ(sprᢶ A_0)
   at sprᥙ.ᜃ(sprᢶ A_0)
   at sprᣣ.ᜂ()
   at sprᣣ.ᜀ()
   at sprᣣ.ᜁ()
   at sprᥙ.ᜃ(sprᢶ A_0)
   at Spire.Pdf.Widget.PdfPageCollection.ᜀ(sprᣛ A_0, Int32 A_1, Int32& A_2, Int32& A_3)
   at Spire.Pdf.Widget.PdfPageCollection.ᜀ(Int32 A_0, Int32& A_1, Boolean A_2)
   at Spire.Pdf.Widget.PdfPageCollection.ᜀ(Int32 A_0)
   at Spire.Pdf.Widget.PdfPageCollection.get_Item(Int32 index)
   at Spire.Pdf.Widget.PdfPageWidgetEnumerator.get_Current()
   at Peak.Plugins.Watermark.SpireWatermarkExtractor.StampFile(String fileIn, String fileOut, String waterMark)
   at Peak.Plugins.Watermark.SpireWatermarkExtractor.Exract(DataPointExtractorInputs inputs, DataPointResults results)
   at Peak.BaseEngine.Central.legacy.LegacyExtraction.ExecuteAllDynamicDataPointExtractors() in C:\Users\saurabhd\Apex\ApexIngestion\Peak.BaseEngine.CentralStd\LegacyExtraction.cs:line 449


Workaround
I managed to solve the problem by manually adding the files libSkiaSharp.dll and libSkiaSharp.dylib to the WaterMark plugin project and setting the "Copy to Output Directory"

Conclusion
Spire.PDF works very nicely overall. If I had a traditional EXE hard bound to my Watermark class library, the EXE would have resolved the pacakge references and there would be no problems.

To allow for plugin scenarios like the above (plugin), it would be important for Spire.PDF to reference the unmanaged assemblies on .NET Standard 20 and add them automatically to the project. You are already doing this for .NET Framework. Please consider doing something similar for .NET Standard 20 or provide guidance for the workaround.

Thanks

saurabhd
 
Posts: 6
Joined: Tue Aug 27, 2019 8:37 am

Fri Oct 11, 2019 10:28 am

Hi,

Thanks for your inquiry.
You could install the Spire.Pdf via NuGet and the dependent dlls will be added in your project automatically. But when you reference the dlls from .netstandard2.0 folder manually, you need to add the dependent dlls such as "libSkiaSharp" to your project manually now.

We will add an article to point out the dependencies you need to add in your project while manually referencing the Spire.Pdf dlls from .netstandard2.0 folder.
Once it is completed, we will inform you. Sorry for the inconvenience caused.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Sun Oct 13, 2019 8:48 am

That would be very helpful and avoid needless time spent in discovery.

Thank you.

saurabhd
 
Posts: 6
Joined: Tue Aug 27, 2019 8:37 am

Mon Oct 14, 2019 10:06 am

Hi,

Thanks for your suggestion.
We are preparing this article, once it is completed, we will inform you ASAP. Sorry the inconvenience caused.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Mon Nov 04, 2019 3:02 am

Hi,

Hope you are doing well.
Glad to tell you that the article has been finished. Below is the link for you. How to Mannually Add Spire.PDF as Dependency in a .NET Standard Library Project.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Wed Dec 25, 2019 10:11 am

Hi,

Greetings from E-iceblue.
How's your issue doing? Could you please give us some feedback at your convenience?

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Return to Spire.PDF