js support problem

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

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
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

js support problem

Post by bob_sun »

Hi,

What version of Adobe javascript spec does my Editor 5.5, Build 313.1 support?

Bob
Last edited by bob_sun on Wed Dec 02, 2015 3:07 pm, edited 2 times in total.
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: readFileIntoStream fail in Editor

Post by Will - Tracker Supp »

Hi Bob,

I've copied my response to your question from your other post:
Offhand, I'm not sure what Version of the Adobe JS API we support, or what functions from it and would need to ask the Dev. Team for confirmation. However, 313.1 is an old build and I would recommend downloading and testing build 315 to see if this was an issue with older releases, or if support for this function was implemented later:
https://www.pdf-xchange.com/PDFXVE5.zip
Cheers,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

Is there plan to improve the js engine?
Last edited by bob_sun on Thu Dec 24, 2015 5:53 pm, edited 1 time in total.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: js support problem

Post by Tracker Supp-Stefan »

Hi Bob,

The search we use has access to the file directly, while the JS has a lot of security limitations and restrictions, so I am afraid that there isn't a faster JS method available.

If you need the speed improvement - you might need to get and handle the text yourself:
https://sdkhelp.pdf-xchange.com/vie ... ge_GetText

My colleagues just told me that we will work on and try to add some improvements to the JS speed, but you can't expect great improvements there, so working with the tools provided by the SDK directly and not relying on the JS is preferable.

Regards,
Stefan
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

I noticed that the SDK is separate from the Editor and cost much more. Are the SDK downloads functionality or time limited trials?
Last edited by bob_sun on Thu Dec 24, 2015 5:53 pm, edited 1 time in total.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: js support problem

Post by Tracker Supp-Stefan »

Hi Bob,

You can download the full Editor SDK and test it fully for as long as you like. The only limitation will be that if you save any file with the SDK without a valid license applied - the file will get "DEMO" stamps on each page. Also if you use the rendering part - there will be "DEMO VERSION" text across the rendered raster data. So everything can be tested, and the project build up to the point before finally compiling it for shipping, and at that point you will only need to supply the license code.

As for the implementation of the JS engine - I can not comment, but would assume you will get similar speeds in Adobe.

Regards,
Stefan
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

Hi Stefan,

Can I use the SDK only to do some conveniency works like getPageNthWord() equivalent (no intention to build anything else)? And can the result be exported as .txt file?

And is this all in https://sdkhelp.pdf-xchange.com/vie ... ge_GetText?
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

Please also help with "valid assembly or COM" error as in screenshot.
Attachments
tracker-dll.rar
(24.05 KiB) Downloaded 143 times
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: js support problem

Post by Sasha - Tracker Dev Team »

Hi bob_sun,

Yes, you can make the getPageNthWord equivalent with our Editor SDK. If you'll need further support do ask.

As for your problem:
Are you using Visual Studio? If you can tell us the version of the dll and the version of your Studio (if you are using one), and also the reproduce steps - maybe we can help.
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

We are using vs 2015. The dll version is 5.5.315.0;
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: js support problem

Post by Sasha - Tracker Dev Team »

Another question - what language and project type are you using?
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

C# and the FullDemo project. Made no change to the project.
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

And with the SDK can we do like search from within same paragraph, same page, in bookmark, and watch the result variables in Visual Studio?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: js support problem

Post by Sasha - Tracker Dev Team »

To add a reference the typelib must be registered.
And as it seems from the directory in the screenshot, you try to use the end-user Editor dll version and not the one that was installed with the sample.

To register a typelib use

Code: Select all

regsvr32 <full path to .dll>
with admin rights.

As for the second message - you can do all of that. You can look into the text reading process here:
https://www.pdf-xchange.com/forum3 ... 67&t=24449

HTH,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

We are still having this error that some dlls could not be found in references.
Last edited by bob_sun on Thu Dec 24, 2015 5:54 pm, edited 1 time in total.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: js support problem

Post by Sasha - Tracker Dev Team »

Have you registered your typelib with regsvr32? Did you manage to add the reference to the project? And also, do you have the AxPDFXEdit inside the project references?
The properties of the AxPDFXEdit on my machine contain this path "FullDemo\obj\x86\Debug\AxInterop.PDFXEdit.dll"
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

Yes. No can be compiled.
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

And with the SDK can we do like search from within same paragraph, same page, in bookmark, and watch the result variables in Visual Studio?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: js support problem

Post by Sasha - Tracker Dev Team »

Look at my previous messages - yes you can do all of that.
As for the compiling problem - we will try to investigate.
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

Hi,

It now compiles OK. The FullDemo can work.
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

Can we get an example on how to use api examples?
Last edited by bob_sun on Thu Dec 24, 2015 5:54 pm, edited 1 time in total.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: js support problem

Post by Sasha - Tracker Dev Team »

https://www.pdf-xchange.com/forum3 ... 588#p95588
There is a code that gets the text from the rectangle on the page. In your case, it will be easier because you'll need a text from whole page. As you see there, the GetText is used with null argument. Try using that for starters.

HTH
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

Thanks. Some problems after trying:

1. After executing var x = curPage.GetText(null);
which we inserted at line 919 of MainFrm.cs of FullDemo, we cannot see valid debugging for x, and the "Dynamic view" of the object also cannot be displayed.

2. IPXC_PageText interface is not impelented, so I get errors

text.CharCount

error CS1061: 'IPXC_PageText' does not contain a definition for 'CharCount' and no extension method 'CharCount' accepting a first argument of type 'IPXC_PageText' could be found (are you missing a using directive or an assembly reference?)

3. Also the IPXC_GetPageTextOptions options are important. Is there samples for that?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: js support problem

Post by Sasha - Tracker Dev Team »

Paste your code sample here where the error occurs.

There is no sample for those options for now. Though I can write one, but it will take some time to do that.
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

Lots of .net style options are enumertions. Is IPXC_GetPageTextOption just an aggreation of enumerations or need more like implementing methods (the interface didn't specify methods, though)?

Is this the javascript engine actually used of for getPageNthWord()? And as the javascript has bStrip option, does it make use of the IPXC_GetPageTextOption option?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: js support problem

Post by Sasha - Tracker Dev Team »

Check this topic on sdkhelp - I've updated the sample.
https://sdkhelp.pdf-xchange.com/vie ... extOptions

The getPageNthWord implementation uses our native code not js engine.
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

Thanks.
1 - partial line merge (only in pdf order)
2 - line merge, only with neighbors
Does it include the bStrip space characters removal option as in javascript?

And in ordinary code how can we get pInst of type PDFXEdit.PXV_Inst ?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: js support problem

Post by Sasha - Tracker Dev Team »

This is not the options on how the text is handled. Basically, you must handle the text processing by yourself if you want to achieve your current goals from what I understand. Having IPXC_PageText you must go through characters and parse it for your needs.

As for the PXV_Inst, as you can see in the FullDemo sample, you can get it from control.
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

getPageNthWord(,,bStrip) 3rd options specifies whether to remove punctuation/whitespace, and this is supported in Editor. So there should be a command supporting it?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: js support problem

Post by Sasha - Tracker Dev Team »

Nope, this function is implemented manually by native code which means parsing text and removing necessary spaces. There is no command for it.
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
bob_sun
User
Posts: 166
Joined: Sat Jan 22, 2011 9:11 am

Re: js support problem

Post by bob_sun »

Thanks.
When trying with some test we always get "javascript running longer than expected" menu, and are always forced to close it manually. Is there any toggle (in options or registry) to disable this message in Editor?
User avatar
Roman - Tracker Supp
Site Admin
Posts: 303
Joined: Sun Nov 21, 2004 3:19 pm

Re: js support problem

Post by Roman - Tracker Supp »

bob_sun wrote:When trying with some test we always get "javascript running longer than expected" menu, and are always forced to close it manually. Is there any toggle (in options or registry) to disable this message in Editor?
Yes. Create the following REG_DWORD value in the registry:
HKEY_CURRENT_USER\Software\Tracker Software\PDFXEditor\3.0\Settings\JavaScript\i.ExecTimeout = 0xffffffff.
This will not disable that message forever - it will still appear if your script takes more than 130 years to execute. :)
Post Reply