the setXORColor() #63
bhowardsoftware
started this conversation in
Ideas
Replies: 1 comment
-
Well, as I'm the sole maintainer and very busy since some years now with a lot of other stuff, I would really appreciate if you could just provide a PR with this change. In this PR should be
You can target the 3.0 version for PDFBox 3 or the 0.n version for PDFBox 2, what ever you need. I'll port that to the other version. I can also create a new release if you need that. But for more I currently just lack the time. And at the moment it does not look like that this is changing anytime soon... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I recently switched from a paid for PDF library to PDFBox and pdfbox-graphics2d. Working great!
The only issue is we need an setXORColor() equivalent. Based on other discussions (e.g. stackexchange) others have the same need. However, when you get to the root of what developers really need you find it is just the blend mode from the PDF Spec.
Here is the idea:
I have hacked the source to do this based on an unused AlphaComposit constant and it works well. I can share my one line of code (below) but this could be done better with the above idea. No problem taking a stab at it, but I don't know how this group makes things happen.
added line 475 as shown below.
case AlphaComposite.DST_ATOP:
break;
to
case AlphaComposite.DST_ATOP:
blendMode = COSName.MULTIPLY; // ok, a hack! But gets the same as setXORMode(Color.white);setColor(color);
break;
Regardless - good library! saved me from crafting my own (again).
Beta Was this translation helpful? Give feedback.
All reactions