Getting PDF DPI

Example requests & Code samples for GdPicture Toolkits.
Post Reply
charuvas1
Posts: 38
Joined: Tue Dec 02, 2008 1:49 pm

Getting PDF DPI

Post by charuvas1 » Wed Apr 28, 2010 3:08 pm

Hi,

I want to know DPI of PDF file? Is there any function in PDFreader to get DPI of a file at which it was written?

charu

User avatar
Loïc
Site Admin
Posts: 5594
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Getting PDF DPI

Post by Loïc » Wed Apr 28, 2010 5:49 pm

Hi,

Yes, check this code:

Code: Select all

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim oGdPictureImaging As New GdPicture.GdPictureImaging
        oGdPictureImaging.SetLicenseNumber("XXX") 'Replace XXX by valid commercial or demo KEY

        Dim hPDF As Integer = oGdPictureImaging.PdfReaderLoadFromFile("c:\test.pdf")
        If hPDF > 0 Then
            oGdPictureImaging.PdfReaderSelectPage(hPDF, 1) 'Select Page1
            Dim ImageCount As Integer = oGdPictureImaging.PdfReaderGetImageCount(hPDF)

            For i As Integer = 1 To ImageCount
                Dim ImageID As Integer = oGdPictureImaging.PdfReaderExtractImage(hPDF, i)
                If ImageID <> 0 Then
                    MsgBox("Image No: " + Str(i) + Chr(13) + _
                           "Res X: " + Str(oGdPictureImaging.GetHorizontalResolution(ImageID)) + Chr(13) + _
                           "Res Y: " + Str(oGdPictureImaging.GetVerticalResolution(ImageID)) + Chr(13))
                    oGdPictureImaging.ReleaseGdPictureImage(ImageID)
                End If
            Next
            oGdPictureImaging.PdfReaderCloseDocument(hPDF)
        End If
    End Sub

ksamy
Posts: 15
Joined: Fri Aug 31, 2012 9:34 am

Re: Getting PDF DPI

Post by ksamy » Wed Sep 05, 2012 6:25 pm

Hello,
How do i that same (Getting PDF DPI) in 8.5.33 version.
Because i am getting error when use your code on that version

ksamy
Posts: 15
Joined: Fri Aug 31, 2012 9:34 am

Re: Getting PDF DPI

Post by ksamy » Thu Oct 11, 2012 8:30 am

??

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests