Loading...

Scan and Save PDF multipage Foxpro

Support for GdTwain ActiveX and GdTwain Pro ActiveX/SDK.

Scan and Save PDF multipage Foxpro

Postby adsoft » Sat Oct 25, 2008 2:04 pm

Tendrían un ejemplo en Foxpro de escaneo y grabación de un solo fichero en PDF que contenga varias páginas. Gracias
adsoft
 
Posts: 4
Joined: Sat Oct 25, 2008 2:01 pm

Re: Scan and Save PDF multipage Foxpro

Postby Loïc » Sat Oct 25, 2008 2:10 pm

Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4441
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Scan and Save PDF multipage Foxpro

Postby adsoft » Sat Oct 25, 2008 3:20 pm

Gracias, por la ayuda, pero me da el siguiente mensaje de error:

Código de error OLE 0x8002006: Nombre desconocido

al ejecutar la línea de comando:

Imaging1.TwainPdfStart ("output.pdf")

Espero su ayuda. Gracias de nuevo.
adsoft
 
Posts: 4
Joined: Sat Oct 25, 2008 2:01 pm

Re: Scan and Save PDF multipage Foxpro

Postby Loïc » Sat Oct 25, 2008 5:28 pm

I don't understand why.

Could you give me the code you are using in vfp ?

Best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4441
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Scan and Save PDF multipage Foxpro

Postby adsoft » Sat Oct 25, 2008 5:54 pm

Le acompaño el código:


Code: Select all
PRIVATE Imaging1


Imaging1 = CREATEOBJECT("gdtwainpro.twain")
   
   If Imaging1.TwainOpenDefaultSource()
      Imaging1.SetLicenseNumber('xxx')
      Imaging1.TwainSetAutoFeed (.t.)
      Imaging1.TwainSetAutoScan (.t.)
      Imaging1.TwainSetCurrentResolution (300)
      Imaging1.TwainSetCurrentPixelType (1)
      Imaging1.TwainSetCurrentBitDepth (8)
      Imaging1.TwainPdfStart ("output.pdf")
     
      DO Whil Imaging1.CreateImageFromTwain(Me.hWnd) <> 0
            nImageID = Imaging1.GetNativeImage
            Imaging1.TwainAddGdPictureImageToPdf(nImageID)
            Imaging1.CloseImage (nImageID)
      endd
     
      Imaging1.TwainPdfStop
      Imaging1.TwainCloseSource
      MsgBox "Done !"
   Else
      MsgBox "can't open default source, twain state is: " & Trim(Str(Imaging1.TwainGetState))
   End If



Gracias por su ayuda.
adsoft
 
Posts: 4
Joined: Sat Oct 25, 2008 2:01 pm

Re: Scan and Save PDF multipage Foxpro

Postby Loïc » Sat Oct 25, 2008 6:07 pm

Hi,

First your code is not a valid vfp code.
Second, I see you are using GdTwain Pro first version. This version can't create multipage PDF files. This feature is only avaible in the V2.


I give you a good one using GdTwain Pro 2:


PRIVATE oTwain


Code: Select all
oTwain = CREATEOBJECT("gdtwainpro2.twain")

WITH oTwain as gdtwainpro2.twain
     .SetLicenseNumber('xxx')
     If .TwainOpenDefaultSource()
        .TwainSetAutoFeed (.t.)
        .TwainSetAutoScan (.t.)
        .TwainSetCurrentResolution (300)
        .TwainSetCurrentPixelType (1)
        .TwainSetCurrentBitDepth (8)
        .TwainPdfStart ("output.pdf")
         DO WHILE .TwainAcquireToGdPictureImage <> 0
            nImageID = .GetNativeImage
            .TwainAddGdPictureImageToPdf(nImageID)
            .CloseImage (nImageID)
            .TwainPdfStop
         ENDDO   
        .TwainCloseSource
        MESSAGEBOX("Done.")
     ELSE
         MESSAGEBOX("Can't open default source.")
     ENDIF
ENDWITH



Best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4441
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Scan and Save PDF multipage Foxpro

Postby adsoft » Sat Oct 25, 2008 6:21 pm

Gracias de nuevo por su rápida respuesta, pero sigue dándome el siguiente error:

"La variable de tipo Object o la variable de bloque Wtih no está establecida"

al ejecutar la línea del código:

.TwainAddGdPictureImageToPdf(nImageID)

Cuál es el problema?

Gracias
adsoft
 
Posts: 4
Joined: Sat Oct 25, 2008 2:01 pm


Return to GdTwain [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest