Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to convert PDF UMAT file into Fortran file? 1

Status
Not open for further replies.

roudan

Geotechnical
Sep 7, 2020
38
Hi

I have a UMAT PDF file with 5000 lines, I am trying to convert PDF to text file. After conversion, the format is all messed up. I am wondering if you have some experience before for this conversion? Thanks
 
Replies continue below

Recommended for you

Can you post the file? I've not done this in particular, but have done a fair number of one-offs of all sorts of formats for similar purposes.
 
You can convert it to doc format first and then copy the content to txt or whichever text file format you need. Usually such conversion works fine, especially when there are no tables or images and that must be the case here.
 
I tried to convert PDF to word, and I got images in the word.
 
I ran Omnipage and since it's a nice clean document it seems to have done a decent job.

At least spot check it for errors. Not sure why a text file was converted to an image; it says in the PDF "Produced by: Microsoft print to PDF" so maybe there is a setting to make bitmap that might be changed to produce a textual version.

 
Thanks 3DDave, are you using the OmniPage Ultimate? I downloaded a trial version and trying to do conversion by performing OCR. The result is pretty good. Thank you so much. Now the problem is the column locations are all shiftted. I have not used Fortran for a long time, I believe line continuation has to be on column 6 and all the coding starts from column 7? do you have solution to shit the column? Thanks



Fortran 77 is not a free-format language, but has a very strict set of rules for how the source code should be formatted. The most important rules are the column position rules:

Col. 1 : Blank, or a "c" or "*" for comments
Col. 1-5 : Statement label (optional)
Col. 6 : Continuation of previous line (optional)
Col. 7-72 : Statements
Col. 73-80: Sequence number (optional, rarely used today)
Most lines in a Fortran 77 program starts with 6 blanks and ends before column 72, i.e. only the statement field is used.
 
Ah - I see that Omnipage uses tabs instead of spaces to format - I'll have to look to see how to get it to use fixed space.
 
Well, that's frustrating.

I've got an older version which is currently ignoring at least one "$" used as a continuation flag. Inexplicably it also ignores the "C" character unless there are more characters on the same line; probably the same problem as the missing "$" and maybe from looking for words/character groups.

I used the internal image enhancement to force all the color characters to be seen using Brightness 100.

I did not find a uniform-space character option and the use of proportional spaces causes some column shifts.

With Notepad++ I could strip off the leading line numbers, but fixing the indentation will be a manual process. It seems as if the tabs are set to duplicate location and not an accurate number of characters.

A text-backed PDF will probably have the same problem - Postscript/PDF records the location on the page rather than as a matrix location of row and column.
 
Thank you 3DDave, I appreciate your help. I will try to fix it manually.
 
It reminds me that long ago I made a bitmap font change that made the space character into a visible one so that I could see the difference between tabs and spaces. It was handy. If a font that did that been used for your printout the OCR software could be trained to see it as a space character and not create tab characters at all.

Unfortunately most users are concerned only with interactive use of text and many editors can be configured to show these as a symbol, so they don't need a font. It's only use now is for printed or bitmapped material and there is little of either used to share text and for similar reasons it seems to the tools to extract such text from bitmaps is also lacking.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor