I have a requirement to create an "image only" pdf file from a source pdf file. An "image only" pdf file does not have any extractable or searchable text. The "image only" pdf file must be reduced to black and white color depth. I have code that loops over the pages of the source pdf file and gets a bitmap image of each page: Using ms As New MemoryStream() Dim res As New Devices.Resolution(300) Dim bd As New Devices.BmpDevice(res) bd.Process(objPdfDocument.Pages(intCurrentPage), ms) Dim bmp As Drawing.Bitmap = New System.Drawing.Bitmap(ms, True) End Using
I run each bitmap through a converter routine that dithers the color image of the page to black and white. The page image has any header/footer text from the original page. How do I then place the page images into a new pdf file to produce my "image" pdf file. These images are not document images but an image of the whole page.
Also, is there a way to strip out all extractable/searchable text from a pdf file? Thanks.
I need to create image only PDF files either at the current color depth or dithered to black and white. I am looking for a way to create an image only PDF file by simply removing any extractable/searchable text from the PDF file leaving the image of each page. My current approach is to get the image of each page and place these images into a new PDF file effectively removing all searchable/extractable text. This is fine if I also need to convert color page images to black and white pages but if the pages can remain in color then just removing the extractable text might be significantly faster than getting and inserting images just to remove searchable text. Thanks.