PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 9:50 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Apr 25, 2018 4:22 pm 
Offline

Joined: Wed Apr 18, 2018 7:17 pm
Posts: 6
I am using the WPF build of PDFSharp, version 1.32.2608.0.

I am trying to draw transparent text over the top of an image (over the top of an image of text, so that the user can select the text).

I tried this:

Code:
gfx.DrawString(text, font, XBrushes.Transparent, x, y);


but the drawn text was white and clearly visible over the text in the image.

I tried creating my own brush with full transparency:

Code:
new XSolidBrush(XColor.FromArgb(0,255,255,255)


same result, if I changed the custom brush to a color other than white, it just draws the color and ignores the transparency value. I also tried using 255 as the transparency value just in case, same result.

How do I draw ACTUAL transparent text? Or some workaround that accomplishes what I said at the beginning?

Any help is appreciated.


Last edited by prw56 on Wed Apr 25, 2018 4:33 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 25, 2018 4:29 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
Hi!

Welcome to the forum.

See also:
viewtopic.php?f=2&t=832

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 25, 2018 4:35 pm 
Offline

Joined: Wed Apr 18, 2018 7:17 pm
Posts: 6
Sorry about that, I added some more details, let me know if anything else is missing or if my question needs more explaining.


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 25, 2018 8:27 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
Does the problem still exist with PDFsharp 1.50 RC2a?

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


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 25, 2018 8:36 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
Did you set the PDF version to 1.4 or higher?
Code:
if (document.Version < 14)
    document.Version = 14;

Source:
http://pdfsharp.net/wiki/ColorsCMYK-sample.ashx

_________________
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  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 144 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