Custom tool (PagesMarkupTool) - Copy text from selection  SOLVED

PDF-XChange Editor SDK for Developers

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

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.
zarkogajic
User
Posts: 1473
Joined: Thu Sep 05, 2019 12:35 pm

Custom tool (PagesMarkupTool) - Copy text from selection

Post by zarkogajic »

Hi Support,

Is this the last version of the CustomTool sample code: download/file.php?id=21250, from viewtopic.php?p=166942#p166942 ?

Can you provide some guidance / sample code on how to best adjust the ProcessSelRegions() to extract the text under the selected region (beside what it already does - grabs the image) ?

That is, what the "Select Page Region" tool does when using Copy after selecting a page region (the text copy part of it).

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

Re: Custom tool (PagesMarkupTool) - Copy text from selection  SOLVED

Post by zarkogajic »

Hi Support,

Ok, I've used that code - and all seems to work as expected.

As for "Copy text from selection" part of the question - I'm using IPXC_Page.GetText and looping through lines to get the text "under" PageRegions.Rects.

All working as expected...

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

Re: Custom tool (PagesMarkupTool) - Copy text from selection

Post by Stefan - PDF-XChange »

Hello zarkogajic,

Sorry that we didn't follow up on the initial post! And glad to see that you've got the code working on your end as well!

Kind regards,
Stefan