Skip to main content
harmoniium
Known Participant
May 10, 2019 3:42 PM UTC
Question

How to open Acrobat Pro DC in Scan Mode from VB.NET

Our company has upgraded to Acrobat Pro DC from Adobe Pro X and the following line of code no longer functions to open Adobe in Scan mode:

AdobeAcro.MenuItemExecute("Scan")

Can someone direct me to help files for coding with Acrobat Pro DC with VB.NET?  

Thank you,

Anthony

This topic is closed to new replies. Start a new post to keep the conversation going.

16 replies

Legend
Jun 6, 2019 3:33 PM UTC

the SDK is free to download. There are no tools that I can think of.

Translate
harmoniium
Known Participant
May 31, 2019 2:28 PM UTC

I now have DC installed on my machine so I can actively work with it.  I see that the menu items are gone and I understand that my code as it worked with X will not work with DC.  I am trying now to open DC from my application so that it is connected to my application so when a file is scanned through the DC interface it will be stored in my system.  Does this make sense?  

This was my code:

           Dim sPDFFileName As String = Path.GetTempFileName.ToLower.Replace(".tmp", ".pdf")

            AdobeAcro.MenuItemExecute("Scan")

            AVDoc = CType(AdobeAcro.GetActiveDoc, Acrobat.AcroAVDoc)

            If AVDoc IsNot Nothing Then

                If AVDoc.IsValid Then

                    'continue

                    PDDoc = CType(AVDoc.GetPDDoc, Acrobat.AcroPDDoc)

                    m_PDFPageNumbers = PDDoc.GetNumPages

                    PDDoc.Save(1, sPDFFileName)

                    PDDoc.Close()

                End If

                AVDoc.Close(CInt(True))

            End If

            AdobeAcro.CloseAllDocs()

            AdobeAcro.Exit()

            KillAdobe()

            If File.Exists(sPDFFileName) Then

                'open it for editing

                Dim pInfo As New ProcessStartInfo

                'Start the correct version of acrobat from the existing path

                pInfo.FileName = StartUp.DetectAcrobat

                pInfo.Arguments = "/A ""zoom=45&pagemode=thumbs"" """ & sPDFFileName & """"

                launchProcess = New Process

                launchProcess = Process.Start(pInfo)

                launchProcess.WaitForExit()

                ' Other processing before returning sPDFFileName to the calling object.

            End If

So, I wonder if I can open DC from my application in a similar fashion so whatever is scanned is returned to my application.

Thank you,

Translate
harmoniium
Known Participant
Jun 4, 2019 7:27 PM UTC

Is there a way to open an instance of Acrobat DC from a .NET application with the intention of scanning a document and saving said document to the .NET application?   The idea is to keep the scanning within our application, but use Acrobat as the scan tool.

Thank you

Translate
lrosenth
Adobe Employee
Adobe Employee
Jun 4, 2019 9:23 PM UTC

No.

Translate
Legend
May 29, 2019 6:20 PM UTC

The Acrobat SDK contains supported interfaces. There isn’t one to do this. Notice that you were executing a menu item - it was never a special function to enter scanning from your app. There just happened to be a Scan menu item, which you found useful. Now notice most menus are removed in DC. That’s why it no longer works.

Translate
harmoniium
Known Participant
May 29, 2019 5:19 PM UTC

So the company has moved to DC from X and our application with X opened Adobe ready to scan.  Are you saying that this method was never intended to be included in X or that it was an accident? 

Is there documentation on how to code for DC in .NET code?  Would you send me more information so I can work on a solution?

Thank  you,

Translate
Legend
May 10, 2019 5:22 PM UTC

Pretty sure no. It’s just sheer luck that there was once a menu item that entered scan mode.

Translate
Participant
Oct 22, 2020 9:21 AM UTC

With the Scan menu gone from Acrobat DC why is MenuItemIsEnabled("Scan") still returns a True?

 

A False return value would make more sense since there is no menu item with that name anymore.

 

Regards,

Peter

 

Translate
Bernd Alheit
Community Expert
Community Expert
Oct 22, 2020 9:50 AM UTC

The menu item "Scan" exists in Javascript. It is the name for following entry:

 

File > Create > PDF from Scanner

Translate
Legend
May 10, 2019 4:52 PM UTC

Items removed from the menu have no replacement.

Translate
harmoniium
Known Participant
May 10, 2019 5:02 PM UTC

This line of code opens an instance of Acrobat in Scan mode.  Is there a way to do that with DC?

Translate