PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Nov 03, 2024 7:20 am

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: Sun Oct 06, 2024 7:16 am 
Offline

Joined: Sat Nov 20, 2021 4:34 am
Posts: 8
Hello All
I hope someone can help me. I just updated my PDF Sharp through NuGet, to 6.1.1 PDFsharp-WPF and now my project has over 300 errors.

Errors are:
BC30652 Reference required to assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' containing the type 'Typeface'

also: 'Bold' is not a member of 'XFontStyle'
'Value of type 'Color' cannot be converted to 'XColor'

What have I missed? Is it possible to go back??

Thanks for your help
Brad


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 06, 2024 1:31 pm 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 346
You must add a reference to WPF to your project.

Change XFontStyle to XFontStyleEx.

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 07, 2024 1:56 am 
Offline

Joined: Sat Nov 20, 2021 4:34 am
Posts: 8
Thank You () => true

I have changed XFontStyle to XFontStyleEx and also had to change:
Code:
pen = New Pen(Color.Black, 0.5)
to:
Code:
pen = New XPen(XColors.Black, 0.5)
and

Code:
gfx.DrawRectangle(New SolidBrush(Color.YellowGreen), 0, 0, 700, 20)
to:
Code:
gfx.DrawRectangle(New XSolidBrush(XColors.YellowGreen), 0, 0, 700, 20)


and the errors have disappeared.

Thank you for your help


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 07, 2024 8:03 am 
Offline
PDFsharp Guru
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 1000
Location: CCAA
You do not indicate which version you were using previously.

"Pen" and "SolidBrush" are GDI classes and those can only be used with the GDI build of PDFsharp.
"XPen" and "XSolidBrush" are PDFsharp classes that work with every PDFsharp build.

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


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: Google [Bot] and 4 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