Re-Order Pages Programatically

New Here ,
Jan 30, 2020 Jan 30, 2020

Copy link to clipboard

Copied

I deal with larges sets of medical treatment records that I must submit to the government in my client cases in a specific order.  The government wants the treatment notes ordered from most recent to the oldest.  The records typically come from a doctor or hospital, however, in an order in which the oldest are "on top".  Now if every treatment note for a given date was only one page, it would easy enough to get my records in shape for government submission by simply printing to Adobe PDF printer in reverse page order.  But of course that is not the reality: treatment records for a given date can be multi-page.  So for example the 3 pages for treatment records of ##/##/#### must be "kept together in the deck" so to speak.  I am fortunate in that I can rely on this 3 pages already being in the right order (page 1, then page 2, then page 3) but I need to create some type of javascipt that keeps that group together, but puts it along with treatment notes for other dates, in the required date order. 

 

Obviously I would have to OCRed the medical record set, and have to programmatically identify each page as being of a certain date.  Given that medical records are mostly electronically generated, they are mostly "structured" such that the date of the record is usually located in a given location and in an given format.  So for example, we might have "date: ##/##/####" at the top of the page.

 

  Any ideas would be most appreciated! 

TOPICS
Acrobat SDK and JavaScript, Edit and convert PDFs, Scan documents and OCR

Views

55

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jan 30, 2020 Jan 30, 2020

Copy link to clipboard

Copied

LATEST

This type of thing can be complicated. Whether or not it can be done depends on the consistency and uniqueness of the dates. But sure, the page text can be scanned for the date, and if it can reliably be extracted, then the pages can be sorted. No problem. But unless you are a programmer and are just looking to be pointed in the right direction, this type of script is outside the scope of this forum. 

 

I do this exact type of script developement all the time. Contact me at www.windjack.com if you need consulting/training/developement help.

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines