Loading...

PDF to PDF searchable (size problem)

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

PDF to PDF searchable (size problem)

Postby canalai » Thu Sep 16, 2010 5:25 pm

Hi,
I'm using your sample code for creating a pdfseacheable from an existing pdf and it works.

My application monitoring a folder and convert the pdf files to pdf searchable. In this folder there are pdf not searchable.
But, the new pdf has a size major then the original pdf.

Can I reduce more the size of the resultant pdftext? It is an essential requirement to reduce the size of the file for the client.

Thanks,

SOFTWARE:
Microsoft Visual Studio 6.0 (SP6) : Microsoft Visual Basic 6.0
gdpicturepro5.ocx (product version: 5.12.0006 ; product name: GdPicture Pro 5 - Imaging ToolKit )

CODE USED:

Code: Select all
Public Function PdfToPdfText(ByRef sError$, ByVal sLicense$, ByVal sPathOCRData$, ByVal iTesseractDictionary%, ByRef sPdfIn$, ByVal sPdfText$) As Boolean
    Dim bRet As Boolean
    Dim nPage As Long
    Dim oImaging As Object, oGdViewer As Object
    Dim RasterizedPage As Long
    Dim lCompression As Long
    Dim lCompressioncambiada As Long
   
    On Error GoTo Error:
    bRet = True
   
    Set oImaging = CreateObject("gdpicturepro5.Imaging")
    Set oGdViewer = CreateObject("gdpicturepro5.GdViewer")
    oGdViewer.SetLicenseNumber (sLicense)
    oImaging.SetLicenseNumber (sLicense)
    oImaging.SetLicenseNumberOCRTesseract (sLicense)
   
    oGdViewer.LockControl = True
    oGdViewer.PdfDpiRendering = 200
    oGdViewer.DisplayFromPdfFile (sPdfIn)
    oImaging.PdfSetJpegQuality (5)
    oImaging.TwainPdfOCRStartEx (sPdfText)
   
    For nPage = 1 To oGdViewer.PageCount
        oGdViewer.DisplayFrame (nPage)
        RasterizedPage = oGdViewer.GetNativeImage
        Call oImaging.TwainAddGdPictureImageToPdfOCR(RasterizedPage, iTesseractDictionary, sPathOCRData) 'OCRData includes dictionary files
        Call oImaging.OCRTesseractClear
    Next nPage

    oImaging.TwainPdfOCRStop
    oGdViewer.CloseImage
   
    PdfToPdfText = bRet
    Exit Function
Error:
    sError = Err.Description
    PdfToPdfText = False
End Function
canalai
 
Posts: 1
Joined: Tue Sep 14, 2010 4:53 pm

Re: PDF to PDF searchable (size problem)

Postby Loïc » Mon Sep 20, 2010 4:09 pm

Hi,

You have 2 options:

- 1 reduce PdfDpiRendering value. IE: 120
- 2 Convert image to 1BPP after rasterization.

Kind regards,

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


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 2 guests