BookmarkSubscribeRSS Feed
SASUserRocks
Calcite | Level 5

Dear Friends

 

Is it possible to read contents from signed scanned pdf copy to SAS proc sql. Please help

4 REPLIES 4
Patrick
Opal | Level 21

You need first to convert your PDF image to text. You then can parse this text using a SAS data step to extract what you need and store it in a SAS table. You need a table to use SQL.

 

Tika is opensource software that can do such conversion to text. I believe SAS uses Tika (or at least used to) for this as part of Text Analytics.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

PDF is a proprietary binary file.  SAS cannot read much else other than the plain binary code which unless you understand and can parse it, is of no use.  PDF is not a data format, its a render destination.  Whilst there are certain packages in python/R and other languages languages to do certain things, even if you do manage to get anything useful out of it would require full QC and probably a lot of work/processing.  I would highly recommend either returning to source data which is the preferred method, or worst case, type things in manually.  Ultimately PDF is a dreadful format, as far from open as possible, so avoid it as much as possible.

SASUserRocks
Calcite | Level 5

Thanks for the feedback provided. Lets say i can convert pdf to text. Here how can bring check box tick in txt file.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Exactly.  How can you bring in things which aren't text.  Checkbox could be a PDF object, or a picture.  End of the day, you could learn javascript in PDF and export it, or possibly find a third party library to get it (perhaps at a quick search: https://stackoverflow.com/questions/55777812/python-pdf-how-to-read-from-form-elements-like-checkbox), but its going to take a fair bit of effort.  Go back to source data is really the best option.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 626 views
  • 0 likes
  • 3 in conversation