SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Member
    Join Date
    Aug 2008
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Reading values from PDF.

    Hi,

    I get a doc generated in PDF. Is there any way to extract all the values from PDF to be validated against my expected result in a array. When I tried to identify it using TP the PDF window is identified as GUI object in TP. Any suggestions please.

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Location
    Bengaluru
    Posts
    494
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Reading values from PDF.

    Two options..

    TP doesn't identify objects in PDF docuement.

    1. Copy the whole content of PDF and extract values from the copied text
    2. you can use Adobe Acrobat SDK to extract values. But, you will need Adobe Acrobat (full version) to access this SDK. You can't acess this SDK if you just have Adobe Reader.
    Suraj

  3. #3
    Member
    Join Date
    Aug 2008
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Reading values from PDF.

    Hi Suraj,

    Thanks for the update.

    How do u suggest me to do that. using the Send keys "ctrl+c" and "ctrl+v"?

    Regards

  4. #4
    Senior Member
    Join Date
    Jan 2006
    Location
    Bengaluru
    Posts
    494
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Reading values from PDF.

    Yes.

    1. "Ctrl + A" to select whole content
    2. "Ctrl + C" to copy the selected text to clipboard
    3. Extract content from clipboard using SystemUtil's clipboard object
    Suraj

  5. #5
    Member
    Join Date
    May 2007
    Posts
    98
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Reading values from PDF.

    In some versions of Adobe... if not all, "Ctrl + A" only selects the text on the current page. My reader has a 'save as text' function, but it is also unreliable/unpredictable.
    I am now working on taking the raw text before it is transformed into a pdf... which involves com commands and extraction via ftp.
    I sure do with Adobe got along better with TP.
    Disclaimer: I am forever a newbie!

  6. #6
    Member
    Join Date
    Aug 2008
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Reading values from PDF.

    Hi All,

    I use the below code to read the values from PDF.

    Dim cbo As New DataObject

    Sub main()

    cbo.Clear
    IEWindow("httpambgsun837121tiplus2-conventionalservletsdocumentServlet&dmsID& documentId2e71da78 - len IEWindow").Attach
    IEWindow("httpambgsun837121tiplus2-conventionalservletsdocumentServlet&dmsID& documentId2e71da78 - len IEWindow").Maximize

    SendKeys "^a"

    SendKeys "^c"

    SendKeys "^v"

    cbo.GetFromClipboard
    Ret_Pdf = cbo.GetText
    MsgBox Ret_Pdf
    IEWindow("Application=IEXPLORE.EXE Caption='http://ambgsun83:7121/tiplus2-conventional/servlets/documentServlet_&dmsID=&documentId=2e71da7 8 - len'").Attach


    End Sub



    I copy it to a clipboard using ctrl+c and ctrl+v and try to read the values from the clipboard. But I am unable to clear the clipboard after the contents r copied. I still use a clear function to clear the clipboard which doesn’t happen actually. Could u pls give me any suggestions on how to clear the clipboard and get the new data as and when copied.

  7. #7
    Senior Member
    Join Date
    Jan 2006
    Location
    Bengaluru
    Posts
    494
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Reading values from PDF.

    Try using the following windows APIs

    <font class="small">Code:</font><hr /><pre>
    Private Declare Function CloseClipboard Lib "user32" () As Long
    Private Declare Function EmptyClipboard Lib "user32" () As Long
    Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long

    Sub ClearAllClipboard()
    OpenClipboard 0&amp;
    EmptyClipboard
    CloseClipboard
    End Sub

    Sub Main()

    ClearAllClipboard

    End Sub </pre><hr />
    Suraj

  8. #8
    Member
    Join Date
    Aug 2008
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Reading values from PDF.

    Hi Suraj,

    Thanks a lot for the reply.
    I tried to use your code in the below given manner. But when I debug it throws an error in the GetText method “cbo1.GetText”. Am I missing something. Bcoz I have not used API’s so far. So I am not able to understand this clearly.
    ------------------------------------------------------------
    Dim cbo1 As New DataObject
    Private Declare Function CloseClipboard Lib "user32" () As Long
    Private Declare Function EmptyClipboard Lib "user32" () As Long
    Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long
    Sub Main()
    ClearAllClipboard

    cbo1.Clear
    IEWindow("httpambgsun837121tiplus2-conventionalservletsdocumentServlet&amp;dmsID&amp; documentId2e71da78 - len IEWindow").Attach
    IEWindow("httpambgsun837121tiplus2-conventionalservletsdocumentServlet&amp;dmsID&amp; documentId2e71da78 - len IEWindow").Maximize

    SendKeys "^a"

    SendKeys "^c"

    SendKeys "^v"

    cbo1.GetFromClipboard
    MsgBox cbo1.GetText
    Ret_Pdf = cbo1.GetText
    MsgBox Ret_Pdf
    IEWindow("Application=IEXPLORE.EXE Caption='http://ambgsun83:7121/tiplus2-conventional/servlets/documentServlet_&amp;dmsID=&amp;documentId=2e71da7 8 - len'").Attach

    End Sub

    Sub ClearAllClipboard()

    OpenClipboard 0&amp;
    EmptyClipboard
    CloseClipboard

    End Sub

  9. #9
    Senior Member
    Join Date
    Jan 2006
    Location
    Bengaluru
    Posts
    494
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Reading values from PDF.

    What is the error that your are getting?
    Suraj

  10. #10
    Member
    Join Date
    Aug 2008
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Reading values from PDF.

    Hi Suraj,

    Pls find the screenshot for that error

    Regards
    Attached Files Attached Files

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.34%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 06:10 PM.

Copyright BetaSoft Inc.