EMF to Searchable PDF

Example requests & Code samples for GdPicture Toolkits.
Post Reply
User avatar
Site Admin
Posts: 5689
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

EMF to Searchable PDF

Post by Loïc » Tue May 04, 2010 4:29 pm

Code: Select all

Dim oGdPictureImaging As New GdPicture.GdPictureImaging
oGdPictureImaging.SetLicenseNumber("XXX") 'Replace xxx by valid key
'Step1: Apply white background to src image. This can be done drawing the metafile on an empty white canvas
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromMetaFile("d:\test.emf")
Dim ImageWidth As Integer = oGdPictureImaging.GetWidth(ImageID)
Dim ImageHeight As Integer = oGdPictureImaging.GetHeight(ImageID)
Dim NewImage As Integer = oGdPictureImaging.CreateNewGdPictureImage(ImageWidth, ImageHeight, Imaging.PixelFormat.Format24bppRgb, Color.White)
oGdPictureImaging.DrawGdPictureImage(ImageID, NewImage, 0, 0, ImageWidth, ImageHeight, Drawing2D.InterpolationMode.NearestNeighbor)
'Step2: convert new bitmap to searchable PDF
oGdPictureImaging.ConvertTo1Bpp(NewImage) 'Comment this line to keep true colour PDF
Dim PdfID As Integer = oGdPictureImaging.PdfOCRStart("d:\out.pdf", True, "", "", "", "", "")
oGdPictureImaging.PdfAddGdPictureImageToPdfOCR(PdfID, NewImage, GdPicture.TesseractDictionary.TesseractDictionaryEnglish, "C:\Program Files\GdPicture.NET\Redist\Commons\OCR", "")

Posts: 439
Joined: Wed Nov 22, 2017 9:52 am

Re: EMF to Searchable PDF

Post by Gabriela » Fri May 17, 2019 2:16 pm


Using the GdPicture14 version you can benefit from OCR features, which are included in the GdPicture PDF class directly:
Or you can use also the new GdPictureOCR class dedicated for OCR.
Give it a try!
Kind regards,

GdPicture Team

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest