Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problem in reading pdf file?

Problem in reading pdf file?

Scheduled Pinned Locked Moved ASP.NET
helpcsharptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    avika
    wrote on last edited by
    #1

    Hello all, I wand to read a pdf file using asp .Net and want to show contents of pdf file into a text area. Get a lots of code for viewing pdf file or writing the pdf file but not for how to read a pdf file. Please help me...

    L 1 Reply Last reply
    0
    • A avika

      Hello all, I wand to read a pdf file using asp .Net and want to show contents of pdf file into a text area. Get a lots of code for viewing pdf file or writing the pdf file but not for how to read a pdf file. Please help me...

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Well I figured out a way to do it, but it requires that you have the full version of Adobe installed on your PC so that you can gain access to the Adobe APIs (which doesn't technically qualify as a free way to do it). Here is the code I used to read the contents of a PDF. You will have to add a reference to the Adobe APIs in your project: Dim objPDFPage As AcroPDPage Dim objPDFDoc As New AcroPDDoc Dim objPDFAVDoc As AcroAVDoc Dim objAcroApp As AcroApp Dim objPDFRectTemp As Object Dim objPDFRect As New AcroRect Dim lngTextRangeCount As Long Dim objPDFTextSelection As AcroPDTextSelect Dim temptextcount As Long Dim strText As String Dim lngPageCount As Long Dim Fora As Long objPDFDoc.Open(tbdocdisplaypath.Text) lngPageCount = objPDFDoc.GetNumPages For Fora = 0 To lngPageCount - 1 objPDFPage = objPDFDoc.AcquirePage(Fora) objPDFRectTemp = objPDFPage.GetSize objPDFRect.Left = 0 objPDFRect.right = objPDFRectTemp.x objPDFRect.Top = objPDFRectTemp.y objPDFRect.bottom = 0 ' objPDFTextSelection = objPDFDoc.CreateTextSelect(lngPageCount, objPDFRect) objPDFTextSelection = objPDFDoc.CreateTextSelect(Fora, objPDFRect) ' Get The Text Of The Range temptextcount = objPDFTextSelection.GetNumText For lngTextRangeCount = 1 To objPDFTextSelection.GetNumText doctext = doctext & objPDFTextSelection.GetText(lngTextRangeCount - 1) Next doctext = doctext & vbCrLf Next doctype = "PDF" objPDFDoc.Close() --------------------------------------------- Alernatively, you can browse these links and try helping yourself http://www.componentsource.com/relevance/pdf/components/index.html?q=pdf+visual http://groups.google.com/group/microsoft.public.dotnet.languages.vb.data/browse\_thread/thread/99a3fbc1608f396e/236c45f7cf2713b5%23236c45f7cf2713b5

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups