PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 2:30 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Jul 07, 2023 7:38 am 
Offline

Joined: Fri Jul 07, 2023 7:28 am
Posts: 2
Hello,

Thank you for this very useful software.

I have a Blazor project targetting .Net6.0 which builds and works ok.
However, I get this warning:

NU1701 Package 'PDFsharp 1.50.5147' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net6.0'. This package may not be fully compatible with your project.

Also, when I change XFontStyle to XFontStyleEx, the code does not compile. There is no reference to .Net Framework in the csproj file e.g.
<TargetFramework>net6.0</TargetFramework>
...
<PackageReference Include="PdfSharp" Version="1.50.5147" />

I believe I am using the latest version of PdfSharp from empira. I have not tried "PdfSharpCore" from Stefan Steiger as I assumed it was something quite different and irrelevant to this problem.

Thanks for any guidance with this,

James.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 07, 2023 8:51 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 916
Location: CCAA
When using PDFsharp 6.0.0-preview-2 (the latest published version by empira), you have to use XFontStyleEx. This version of PDFsharp targets .NET 6.

When using PDFsharp 1.50, you have to use XFontStyle. This version of PDFsharp targets .NET Framework 3.5.
You are still using PDFsharp 1.50.

Check "Include Prereleases" and switch to PDFsharp 6.0.0-preview-2.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 07, 2023 9:53 am 
Offline

Joined: Fri Jul 07, 2023 7:28 am
Posts: 2
Terrific - thanks!
I hadn't appreciated the 'prerelease' part and now have 6.0.0.0-preview-2 installed with no problems. [I have yet to run the application, but don't expect problems.]

Thanks again for the quick repsponse,

James.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 25, 2023 11:23 am 
Offline

Joined: Tue Jul 25, 2023 11:20 am
Posts: 1
Hi, I just want to note that document rendering fails in Blazor WASM project due to creation of the ILoggerFactory singleton instance.
You can work around this by assigning the singleton to your own instance before using the library:
Code:
 LogHost.Factory = LoggerFactory;


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 363 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group