Some IOperation PagesRange.RangeTypes Custom and CustomRect  SOLVED

PDF-XChange Editor SDK for Developers

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
zarkogajic
User
Posts: 1452
Joined: Thu Sep 05, 2019 12:35 pm

Some IOperation PagesRange.RangeTypes Custom and CustomRect

Post by zarkogajic »

Hi Support,

I'm playing with the op.document.replaceFonts ...

I had a crazy idea of specifying: I only want to change fonts "inside" the bottom half of a page (or pages).

I've tried specifying the "Custom" and the "CustomRect" values - but nothing happens - no changes to the document.

This, I guess means, op.document.replaceFonts ignores PagesRange's Custom/CustomRect values (i.e. is not implemented)?

p.s.
I can do the change on all pages, page range, etc ... I would really want to specify a rectangle (on a page) where the operation would do its magical work ....


-žarko
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2444
Joined: Thu Jun 30, 2005 4:11 pm

Re: Some IOperation PagesRange.RangeTypes Custom and CustomRect

Post by Vasyl - PDF-XChange »

Hi Zarko.

You are right, it is not implemented yet.
But seems the idea isn't too crazy and we will make a feature request to do it in the future. :wink:

Cheers.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1452
Joined: Thu Sep 05, 2019 12:35 pm

Re: Some IOperation PagesRange.RangeTypes Custom and CustomRect

Post by zarkogajic »

Hi Vasyl,
But seems the idea isn't too crazy and we will make a feature request to do it in the future. :wink:
Wohoo :)

Am actually looking into being possible to do the following:

image.png

So, specify (in this sample 4) custom rectangles on a page and have the magic do its work ...

-žarko
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2444
Joined: Thu Jun 30, 2005 4:11 pm

Re: Some IOperation PagesRange.RangeTypes Custom and CustomRect

Post by Vasyl - PDF-XChange »

It will not be so difficult to change just the color of the selected fragments of text. As shown in your screenshot.
But it will be incredibly difficult to change the font for text-fragments exactly and only covered by the selection rectangle. Because when you change font - it may (will) reflow the other text in the text block.
If you want only to change the color of text - maybe it can be implemented as a separate feature, like HighlightText tool, but it will change the color of the selected text instead of adding the highlight-comment to it.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1452
Joined: Thu Sep 05, 2019 12:35 pm

Re: Some IOperation PagesRange.RangeTypes Custom and CustomRect

Post by zarkogajic »

Hi Vasyl,

Yes, I only need color changing (keep font type/size..).

-žarko
zarkogajic
User
Posts: 1452
Joined: Thu Sep 05, 2019 12:35 pm

Re: Some IOperation PagesRange.RangeTypes Custom and CustomRect

Post by zarkogajic »

Hi Support,

Any movements here regarding the suggested improvement?

-žarko
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19792
Joined: Mon Jan 12, 2009 8:07 am
Contact:

Re: Some IOperation PagesRange.RangeTypes Custom and CustomRect

Post by Stefan - PDF-XChange »

Hello zarkogajic,

I did ask Vasyl if he wants a ticket, but have not heard back. I will ask him now if that found it's way in 386, and if not what further steps he would like us to take!

Kind regards,
Stefan
zarkogajic
User
Posts: 1452
Joined: Thu Sep 05, 2019 12:35 pm

Re: Some IOperation PagesRange.RangeTypes Custom and CustomRect

Post by zarkogajic »

Hi Stefan

Ok, thanks ...

-žarko
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2444
Joined: Thu Jun 30, 2005 4:11 pm

Re: Some IOperation PagesRange.RangeTypes Custom and CustomRect

Post by Vasyl - PDF-XChange »

Hi Zarko.

We had a conversation with our devs and found that using the ReplaceFonts operation in current implementation - is the wrong way to proceed in your case. Because when you have two or more rectangles to change text-color inside all of them, when you try to process such rectangles one by one, literally on the first or second rectangle, after using the ReplaceFonts on it - the text on the page might be slightly repositioned (or even reflowed in the worst case). So the following rectangles might quickly lose their 'relationship' with the original text...

Maybe in the future, especially for cases when ReplaceFonts is used only to replace text-colors - we will use another method that will not cause such text fluctuations...

Cheers.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1452
Joined: Thu Sep 05, 2019 12:35 pm

Re: Some IOperation PagesRange.RangeTypes Custom and CustomRect  SOLVED

Post by zarkogajic »

Hi Vasyl,

Ok, thanks.

What I'm really up to, you might remember, is something else: (still) looking how to change the text color "behind" link annotation.

-žarko
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7356
Joined: Wed Mar 25, 2009 10:37 pm
Contact:

Re: Some IOperation PagesRange.RangeTypes Custom and CustomRect

Post by Paul - PDF-XChange »

Hi, Zarko,

today I received notification that ticket RT#6793: FR: Adding IOperation PagesRange.RangeTypes Custom and CustomRect has made it's way into the next build.

Please test it in 10.4.0.390 when it is available next week.
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
zarkogajic
User
Posts: 1452
Joined: Thu Sep 05, 2019 12:35 pm

Re: Some IOperation PagesRange.RangeTypes Custom and CustomRect

Post by zarkogajic »

Hi Paul,

Woohoooo works like a charm!!

Thanks for implementing!


-žarko
zarkogajic
User
Posts: 1452
Joined: Thu Sep 05, 2019 12:35 pm

Re: Some IOperation PagesRange.RangeTypes Custom and CustomRect

Post by zarkogajic »

Hi Support,

Actually I think I've found a bug behavior.

I have an OCR'ed document where trying to replace fonts (IOperation) in some sections of the document would end up with "The parameter is incorrect". Tested with EU Editor (selected the same section) same issue.

I'll send you the document....

p.s.
I thought it was related to this (but was wrong): viewtopic.php?t=43806

-žarko
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7356
Joined: Wed Mar 25, 2009 10:37 pm
Contact:

Re: Some IOperation PagesRange.RangeTypes Custom and CustomRect

Post by Paul - PDF-XChange »

Hi, zarkogajic

the devs are looking into it now.

:)
Best regards

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