Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

In my window application i am using Quick pdf to find height,width of pdf.please refer the below code.But sometimes quickpdf can't able to find correct value.so i want to do the task using iTextSharp. How to find pdf height,width using iTextSharp?

Try
        Dim qp1 As New iSED.QuickPDF
        Dim sPDFHei, sPDFWid As Double
        Dim iPgCnt As Integer
        qp1.UnlockKey("6510E9D5C3938A920B3A8D7293C6DF00")
        qp1.LoadFromFile(sFilePath & "\" & cmbArticles.Text)
        qp1.SetMeasurementUnits(0)
        iPgCnt = qp1.PageCount
        For i As Integer = 1 To iPgCnt
            'MsgBox("pagecount=" & iPgCnt)
            qp1.SelectPage(i)
            'MsgBox("PageNumber=" & i)

            sPDFHei = qp1.PageHeight : sPDFWid = qp1.PageWidth
            sPDFHei = Math.Round(sPDFHei, 2) : sPDFWid = Math.Round(sPDFWid, 2)

            ''If sPDFWid <> 8.26 And sPDFHei <> 11.69 Then
            If sPDFWid > 520 Or sPDFHei > 600 Then
                MsgBox("Article PDF size should not exit 7.22 x 8.33" & vbCrLf & "Problem in template:" & i)
                Exit Function
            End If
        Next
        qp1.clear()


        Checkpdfsize = True
    Catch ex As Exception
        MsgBox(ex.Message, MsgBoxStyle.Information, "CheckPdfSize")
    End Try
Posted
Updated 28-Feb-14 20:27pm
v2

1 solution

Posting this solution as your question has been answered on your cross-post at StackOverflow.http://stackoverflow.com/questions/22111474/find-height-and-width-of-pdf-using-itextsharp[^]

You may find these other stackoverflow[^] references useful too.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900