p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Pro VB.NET 2002/2003 (http://p2p.wrox.com/forumdisplay.php?f=74)
-   -   Convert PDF to Tiff in code (http://p2p.wrox.com/showthread.php?t=53354)

hexOffender January 29th, 2007 05:27 PM

Convert PDF to Tiff in code
Is there a way to convert a PDF to a Multipage Tiff in VB code.
Can it be done using an Acrobat reference(COM). I know you can save as Tiff in Acrobat. Could I just do shell calls to save As?

hexOffender January 30th, 2007 04:16 PM

I have cobbled together this code so far:

 Dim FileName As String
        Dim image As String = "Image"

        AcroXApp = CType(CreateObject("AcroExch.App"), Acrobat.CAcroApp)
        'Removing toolbar buttons from the user interface
        With AcroXApp
        End With
        AcroXAVDoc = CType(CreateObject("AcroExch.AVDoc"), Acrobat.CAcroAVDoc)
        FileName = "C:\Image.pdf"
        AcroXAVDoc.Open(FileName, "Acrobat")

        AcroXPDDoc = CType(AcroXAVDoc.GetPDDoc, Acrobat.CAcroPDDoc)
        AcroXPDDoc.ClearFlags(&H1) 'Keep Acrobat from querying a file save when component closes


        'SetParent(AcroHandle, 0)

I can open the SaveAs Dialogue, but How can I populate it with the filename I want("Image.tiff"). And then I wuld like to have this done without showing the Acrobat screens.

Dannili August 5th, 2017 04:59 AM

Convert PDF to Tiff in vb.net code
I recommend you use xspdf control http://www.xspdf.com/guide/pdf-tiff-converting/
here is the vb.net code to convert pdf to tiff image

Dim pdfConverter As PdfImageConverter = New PdfImageConverter("sample.pdf")
' Set the dpi, the output image will be rendered in such resolution
pdfConverter.DPI = 96
Dim i As Integer = 0
Do While (i < pdfConverter.PageCount)
' Convert each pdf page to a single page tiff image with original page size
'Image pageImage = pdfConverter.PageToImage(i);
' Convert pdf to single page tif in customized image size
Dim pageImage As Image = pdfConverter.PageToImage(i, 500, 800)
' Save converted image to tiff format
pageImage.Save(("Page " _
+ (i + ".tiff")), ImageFormat.Tiff)
i = (i + 1)

Olivia_NY April 13th, 2018 07:38 AM

Hello! Try to use this one - https://www.coolutils.com/TotalMailConverterPro

The best way to convert .eml in to .pdf [:)]

All times are GMT -4. The time now is 10:35 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.