+ Reply to Thread
Results 1 to 9 of 9

Thread: pdf rendering and text search

  1. #1
    selvamarcadu is offline VB.NET Forum Newbie selvamarcadu is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Jul 2009
    Age
    23
    Posts
    17
    Reputation
    17

    Default pdf rendering and text search

    Hi all,

    I am newbie in vb.net and have been involved in designing a windows application.

    I want to render the pdf document within vb.net form and highlight certain keywords.I read about AxAcroPDFLib.AxAcroPDF and tested it, but it does not seem to give text searching capability.I will be happy to get your sugestions to render pdf pages, with text highlighted for certain keywords.

  2. #2
    ScottyB's Avatar
    ScottyB is offline VB.NET Forum Enthusiast ScottyB is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Jan 2007
    Location
    Australia
    Age
    40
    Posts
    39
    Reputation
    47

    Default

    Two free alternatives that you could try for rendering a pdf are
    itextsharp or pdfsharp.

    Here are some links to the renderers listed above
    PDFsharp & MigraDoc - Home
    iTextSharp - Tutorial
    iTextSharp | Get iTextSharp at SourceForge.net

    As I have not had much to do with text search and pdf I do not know how these will fair, they are worth checking out though.

    Regards

    ScottyB

  3. #3
    selvamarcadu is offline VB.NET Forum Newbie selvamarcadu is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Jul 2009
    Age
    23
    Posts
    17
    Reputation
    17

    Default pdf rendering and text search

    Thank you for your response,

    itextsharp and pdfsharp seem to concentrate on pdf creation rather than rendering.

    I found this link for acrobat reader, which i am exploring now

    Adobe Acrobat Automation With VB and Windows API




    thanks
    Selvam

  4. #4
    selvamarcadu is offline VB.NET Forum Newbie selvamarcadu is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Jul 2009
    Age
    23
    Posts
    17
    Reputation
    17

    Default pdf rendering and text search

    Hi all,

    I just went to check AxAcroPDFLib.I added acrobat reader com object to tool box.Then dragged it to form.But simply running it gives "Windowless controls are not supported".What does it mean?,Do i need any additional dll?

    I have Adobe 7.0 installed in my machine.


    Thanks,
    Selvam

  5. #5
    selvamarcadu is offline VB.NET Forum Newbie selvamarcadu is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Jul 2009
    Age
    23
    Posts
    17
    Reputation
    17

    Default pdf rendering and text search

    Hi,


    I installed adobe reader 9 version and it worked well.

  6. #6
    selvamarcadu is offline VB.NET Forum Newbie selvamarcadu is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Jul 2009
    Age
    23
    Posts
    17
    Reputation
    17

    Default multiple pdf files in child forms

    Hi,
    After i used acrobat 9.x(AxAcroPDFLib.AxAcroPDF)

    1)I included its com and added to toolbox

    2)I dropped Acrobat Reader to My main form(frmMain)

    3)Then i did, I frmMain.AxAcroPDF1.LoadFile(...)

    4) ChildForm.Controls.Add(frmMain.AxAcroPDF1)

    But the problem is there are multiple mdi childs for the main form.I need to load multiple pdf files for them.But when i load the second mdi child, the first mdi child's pdf content becomes empty.

    Note:childforms are created dynamically

    Help me to load multiple pdf files for each child form.

    Thanks
    Selvam

  7. #7
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute JohnH has a reputation beyond repute
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Age
    37
    Posts
    11,055
    Reputation
    1564

    Default

    You'd want to create one control for each form, similar to this:
    Code:
    Dim pdf As New AxAcroPDF
    pdf.Loadfile(...)
    theForm.Controls.Add(pdf)

  8. #8
    selvamarcadu is offline VB.NET Forum Newbie selvamarcadu is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Jul 2009
    Age
    23
    Posts
    17
    Reputation
    17

    Default pdf rendering and text search

    Hi thanks JohnH,

    I tried it,but "System.Windows.Forms.AxHost+InvalidActiveXStateEx ception" is thrown

    My code looks as,

    Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmMain))
    Dim pdf As New AxAcroPDFLib.AxAcroPDF
    pdf.OcxState = CType(resources.GetObject("AxAcroPDF1.OcxState"), System.Windows.Forms.AxHost.State)
    pdf.LoadFile("path_to_pdf")
    ChildForm.Controls.Add(pdf)
    ChildForm.Show(DockPanel)


    When i place the Adobe Reader control in frmMain ,i could access it.But,when i create a new one it throws such exception.

  9. #9
    selvamarcadu is offline VB.NET Forum Newbie selvamarcadu is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Jul 2009
    Age
    23
    Posts
    17
    Reputation
    17

    Default pdf rendering and text search

    Hi ,its working now,thanks for your support.

    I first showed the form and then loaded the file.

    Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmMain))
    Dim pdf As New AxAcroPDFLib.AxAcroPDF
    pdf.OcxState = CType(resources.GetObject("AxAcroPDF1.OcxState"), System.Windows.Forms.AxHost.State)

    ChildForm.Show(DockPanel) 'This is the line i brought up
    pdf.LoadFile("path_to_pdf")

    ChildForm.Controls.Add(pdf)


    Thanks
    Selvam

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts