requesting a new blend mode or two

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Jojoyubby
User
Posts: 6
Joined: Fri May 21, 2021 5:19 am

requesting a new blend mode or two

Post by Jojoyubby »

I would like to suggest 2 new blend modes to be added for the comments/ area markup

the first one is "invert" or "negative"

the second is "clear out" where 2 comments overlap and the color will be removed in situations like the attached image
image.png
You do not have the required permissions to view the files attached to this post.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: requesting a new blend mode or two

Post by Stefan - PDF-XChange »

Hello Jojoyubby,

I am afraid that the available blend modes are defined in the PDF ISO spec, and as such we can not add any new ones.
Here are some extracts from the ISO Spec:
image.png
And e.g. here are the formulas on how to calculate the "Screen" blend mode:
image(1).png
These have to be defined, so that when you set a "Screen" blend mode in the Editor, and save the file - it can be rendered the same way on another device in another PDF software, so there is no option for us to "add" our own blend modes - as those would not conform to the 'portability' part of the portable document format :)

However your e.g. "Inverse" colour can be achieved with a white annotation with "Difference" blend mode selected:
image(2).png
Kind regards,
Stefan
You do not have the required permissions to view the files attached to this post.
Jojoyubby
User
Posts: 6
Joined: Fri May 21, 2021 5:19 am

Re: requesting a new blend mode or two

Post by Jojoyubby »

Many thanks Stefan,

a follow-up question on measurement comments. Is it possible to change the name of the comment in the property window?
image.png
It can help us automate the complex area calculation in excel where some measurements needed to be subtracted from the overall areas after we export the comments. it is hard to identify which area is corresponding to which measurement with the current auto "string" of name.

cheers.
You do not have the required permissions to view the files attached to this post.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: requesting a new blend mode or two

Post by Stefan - PDF-XChange »

Hello Jojoyubby,

These names can only really be changed with JS.
Something like this:

Code: Select all

var annots = this.getAnnots();
for (var i = 0; i < annots.length; i++){
   if (annots[i].name == "86edfe23-49da-4381-9019ecf1c93a81f2"){
     annots[i].name = "CustomName";
   }
}
would do the trick - but you will also need to ensure that you specify unique names, and my initial name is copied from the properties pane for an annotation I tested with - so you will obviously need to update that for the script to work for you.

And the result after that is that my annotation has it's desired custom name:
image.png
Kind regards,
Stefan
You do not have the required permissions to view the files attached to this post.
Mathew
User
Posts: 645
Joined: Thu Jun 19, 2014 7:30 pm

Re: requesting a new blend mode or two

Post by Mathew »

Here's a simple interactive version with a dialog to enter the name. Select the annotation you want to change first. Paste and run in the javascript console:

Code: Select all

if (this.selectedAnnots[0]) {
	var annotName = app.response({
		cTitle: "Change selected annotation name",
		cQuestion: "Enter new name for selected annotation:",
		cDefault: this.selectedAnnots[0].name
	});
	if (annotName != null) {
		// will fail if the name already exists
		this.selectedAnnots[0].name = annotName;
	}
}else{
	console.println("Nothing selected!");
}
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7388
Joined: Wed Mar 25, 2009 10:37 pm

Re: requesting a new blend mode or two

Post by Paul - PDF-XChange »

slick!

I like it!

:D
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com