Active X and creation of pdf

Questions, comments and suggestions concerning VintaSoft Twain ActiveX.

Moderator: Alex

Post Reply
philipljackson
Posts: 1
Joined: Tue Feb 26, 2019 7:31 pm

Active X and creation of pdf

Post by philipljackson » Tue Feb 26, 2019 7:40 pm

HI

I program in Delphi, your example program works well when creating a .bmp program.

I now have a licenced copy of your product and I am wanting to save my documents as .pdf files.

The procedure VSTwain1.Register returns true so I have the correct credentials in place.

I have added the following to the example application

Code: Select all

         // set settings of PDF encoder
        VSTwain1.PdfEncoder_MultiPage                := True;
        VSTwain1.PdfEncoder_DocumentAuthor           := 'Demo App';
        VSTwain1.Device_Info_GetProductName(VSTwain1.DeviceManager_SelectedDeviceIndex);
         VSTwain1.PdfEncoder_DocumentCreator          := 'Demo App';
         VSTwain1.PdfEncoder_DocumentModificationDate := FormatDateTime('dd/mm/yy hh:mm',now);

        // acquire image(s) from the device
        Repeat
          acquireModalState1 := VSTwain1.Device_AcquireImageModal();

          // if image is acquired
          If acquireModalState1 = ACQUIREMODALSTATE_ImageAcquired Then
          Begin

              VSTwain1.AcquiredImages_Save(0,'c:\1\test.pdf');

            // dispose an acquired image
            VSTwain1.AcquiredImages_Clear();
                      // if scan is canceled
          If acquireModalState1 = ACQUIREMODALSTATE_ScanCanceled Then
            ShowMessage('Scan is canceled.');

          // if scan is failed
          If acquireModalState1 = ACQUIREMODALSTATE_ScanFailed Then
            ShowMessage('Scan is failed: ' + VSTwain1.errorString);

        Until acquireModalState1 = ACQUIREMODALSTATE_None;
The file 'test.pdf' is created but is of zero byte size

Can you please advise if I have missed out something?

Regards

Philip L Jackson

Alex
Site Admin
Posts: 1624
Joined: Thu Jul 10, 2008 2:21 pm

Re: Active X and creation of pdf

Post by Alex » Wed Feb 27, 2019 2:49 pm

Hi Philip,

Our support staff answered to your question. You need to check the return code of the AcquiredImages_Save method.

Best regards, Alexander

Alex
Site Admin
Posts: 1624
Joined: Thu Jul 10, 2008 2:21 pm

Re: Active X and creation of pdf

Post by Alex » Tue Mar 05, 2019 10:51 am

Hi Philip,

Thank you for your help in understanding the problem. The problem is solved in version 6.0.14.3: https://www.vintasoft.com/forums/viewto ... 8959#p8959

Best regards, Alexander

Post Reply