op.scanToImages

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
apx
User
Posts: 25
Joined: Tue Sep 12, 2017 1:43 pm

op.scanToImages

Post by apx »

Hello!
I'm trying to scan with the Control, but somehow I don't succeed. I always get the message
Error [PXVLib]: Scanner is not selected
Here is my code snippet. The Scanner has the Name "PROG-SCANNER OKI".

Code: Select all

            // https://sdkhelp.pdf-xchange.com/view/PXV:op_scanToImages_Options#ImagesToPDFOptions
            string operationName = "op.scanToImages";
            PDFXEdit.IOperation op = null;            
            int id = pdfCtl.Inst.Str2ID(operationName);
            op = pdfCtl.Inst.CreateOp(id);

            PDFXEdit.ICabNode opts = op.Params.Root["Options"];
            
            opts["ScannerName"].v = "PROG-SCANNER OKI";
            opts["ShowNativeUI"].v = true;
            opts["DataTransferMethod"].v = 0;
            
            if (op == null)
            {
                return -1;
            }

            try
            {
                op.Do();
                return 1;
            }
            catch (Exception ex)
            {
                int hr = Marshal.GetHRForException(ex);
                ShowErrMsg(hr);

                return -1;
            }
My goal is to scan a document and create a PDF from it. Is there any other possibility / function?

Many thanks for the help in advance

Alex
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: op.scanToImages

Post by Sasha - Tracker Dev Team »

Hello Alex,

You can see the parameters that we are using by intercepting the scan operation.
You will have to launch a FullDemo application and then do a normal scan procedure via the Scan command. Then select the needed scanner and execute the operation.
Here's how you can catch the operation execution (before it's executed):
viewtopic.php?f=66&t=31055&p=124996&hil ... te#p124996
Then you will have to check whether it's an op.scanToImages operation and see the settings that are being set in the Options dictionary.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
apx
User
Posts: 25
Joined: Tue Sep 12, 2017 1:43 pm

Re: op.scanToImages

Post by apx »

thx I will try it and report.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: op.scanToImages

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply