+ Reply to Thread
Results 1 to 7 of 7

Extracting Strings from .PDF

  1. #1
    Registered User
    Join Date
    12-12-2016
    Location
    Tampa
    MS-Off Ver
    2013
    Posts
    6

    Extracting Strings from .PDF

    Can you masters of the VBAverse help me create an extracting procedure that will be taking specified string from a .PDF?

    The difficult part for me, other than being a beginner in VBA, is that I do not have authority to download any apps on my work computer, i.e. this code will have to match the parameters I give at the bottom.

    WHAT I NEED FOR THE CODE TO ACCOMPLISH.....

    I need a procedure that will open a .pdf (Adobe Acrobat Pro) based on a path variable named "path" and either extract the specified data straight from .pdf to be placed in activecell or write the entire .pdf into an array; and then, extracting the specified data into activecell. Those are the only 2 ways that I think it will work, because the procedure must be limited to just using Adobe Pro and the active workbook. I do not have any size or processing limitations as the .pdf will be at most 5 pages. I will use your input to create other string extraction specifications, so if possible, please provide input that allows for the repetition of your code but with new string extraction specs.

    STRING EXTRACTION SPECS

    I am extracting a code that is unique because it will always have 11 alphanumerical characters that will only be letters and numbers, will contain at least one number, has no spaces or punctuation or symbols, and the string is surrounded by a space on either side. ( I will actually take care of writing the extraction functionality, but I really need help with the methodology of using data from a .pdf.

    Also this is my first post, so please give me input on how better to phrase/structure my post to be more concise. Unfortunately, I cannot provide ANY EXAMPLES!!! as far as code or workbook. I am hoping that what I am asking for is broad enough to not require that. Thanks!

  2. #2
    Registered User
    Join Date
    12-12-2016
    Location
    Tampa
    MS-Off Ver
    2013
    Posts
    6

    Re: Extracting Strings from .PDF

    No takers...?

    Can someone at least tell me if what I am requesting's impossible, so that I can know if I need to look for alternative solutions.

  3. #3
    Forum Contributor
    Join Date
    07-23-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    273

    Re: Extracting Strings from .PDF

    Probably but would be possible only if the PDF was actually saved directly from a document or spreadsheet. If it was scanned from a scanner or printed as a pdf document then I don't think it's possible. Try Googling "VBA extract data from PDF file"!

  4. #4
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    401

    Re: Extracting Strings from .PDF

    If you can first convert the PDF file to an Excel file, with a program like Able2Extract, your task becomes a very easy one. It's very easy to write code that will open other Excel files and extract and manipulate data from that Excel file. But I, for one, do not know how, or even if it is possible, to extract data directly from a PDF file.

  5. #5
    Registered User
    Join Date
    12-12-2016
    Location
    Tampa
    MS-Off Ver
    2013
    Posts
    6

    Re: Extracting Strings from .PDF

    The .pdf was not scanned i.e. I can bring my cursor over and select individual characters.

    Your right Ed, it would be easy, but I cannot download anything onto my work computer.

    What about a way to read the entire .pdf (3-5 pages) into a 2 dimensional array? Then the extraction becomes simple from that point.

  6. #6
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    401

    Re: Extracting Strings from .PDF

    The problem is that the PDF format is a binary format. Just for fun, try opening up your PDF file in an editor or word processing program. See the problem now? You will see the file consists of many "strange characters." Each PDF file encapsulates a complete description of a fixed-layout flat document, including the text, fonts, graphics, and other information needed to display it.

  7. #7
    Registered User
    Join Date
    12-12-2016
    Location
    Tampa
    MS-Off Ver
    2013
    Posts
    6

    Re: Extracting Strings from .PDF

    I see what you mean Ed.

    Last question: In the same fashion that we use the select function in excel, is there anyway to do a select all text in a non-excel file?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Extracting strings from a cell
    By treeantz in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 01-27-2016, 11:53 PM
  2. Extracting Data between two strings
    By daven2cm in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-20-2014, 02:31 PM
  3. Extracting strings from Sub-name
    By konfis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2012, 11:08 AM
  4. Extracting Text Strings
    By rs585832 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-13-2011, 04:28 PM
  5. Extracting strings
    By Esinem in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-25-2009, 09:29 AM
  6. Extracting mid strings from a cell
    By Sultix in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-04-2009, 09:53 AM
  7. [SOLVED] Extracting time from strings
    By Ken McLennan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-23-2006, 11:55 AM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1