At work I have been given a task to organize some documents. Please help me, I’m overwhelmed.

TLDR: Manually separate PDFs into individual documents (variable page length), assign each document to a category, and identify the date of the document. Need a fast way to do it. On Windows.

Here is a longer description of my task.

Goals:

  • Chop up the bulk PDFs to create 1 PDF per document
  • Sort each of them into one of 10 categories
  • Identify the date in each document. Include it in the filename. Optimally, insert it into the document itself (e.g. top right hand corner of first page, in the margin so it doesn’t cover anything)
  • Would be nice:
    • Rerun the OCR; I think it could be better. At home I would use ocrmypdf
    • Clean up the scans: fix alignment, remove artifacts etc (only if effort is trivial and 0% risk of data loss)

Inputs:

  • Printed out, it’s a stack of papers about 6-8cm tall
  • Has been provided in bulk PDFs about 40-60 pages each
  • Most individual documents are 2-5 pages in length, with some being 10-20

Document characteristics:

  • Scanned on an actual scanner; some carefully, others not
    • Have been optimized for small smile size
    • Mostly black & white, some grey scale
  • Business documents, records, official correspondence etc. Typed, not handwriting. English.
  • They are all in some sort of standardized format, but from many different sources, each with their own format
  • Have had some sort of OCR applied to them; it isn’t very good especially when the scans aren’t perfect.

Work environment and constraints

  • Because I am at work, I am using a standard Windows workstation that is set up for office (not developer) use.
  • I have asked for the full version of Adobe Acrobat to be installed, because they have a license for that. I’ve never used it. Maybe it will do all of this but based on how profoundly annoying Reader is, I am skeptical.
  • I can install things that don’t require administrator privileges. I can ask for administrator to install something if I am reasonably confident it’ll be useful and safe but I can’t be annoying asking for things all the time. I strongly prefer open source tools.
  • Cannot under any circumstances use anything online, cloud, external AI. All data must stay local.
  • I might be able to justify using linux in the future if this is an ongoing task (it might be) so linux-only suggestions are welcome but won’t be implemented first-line. Desktop applications > self hosted servers or command line.
  • Zwuzelmaus@feddit.org
    link
    fedilink
    arrow-up
    2
    ·
    5 hours ago

    My opinion: Scan it again. It will be faster than fiddling with the bad PDFs.

    Look at the dates while scanning.

    Later sort them into folders first by year, then by the name of the author/adressee/business partner.

    • endless@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      ·
      4 hours ago

      Originals are unavailable, I only the scans. Which have been printed out of tradition. I could scan them again but it would take a very long time and further decrease the quality. And I don’t have the ability to sit by the scanner to catch the files as the come in. Scanner and workstation are in different locations. Manually separating the existing PDFs by using “print to PDF” would be faster.

    • endless@lemmy.mlOP
      link
      fedilink
      arrow-up
      2
      ·
      6 hours ago

      no way I’ll be able to install docker and whatever else if needed, run a server etc.

  • Sunsofold@lemmings.world
    link
    fedilink
    arrow-up
    3
    ·
    8 hours ago

    I know there are scripting ways to work with PDFs. I was listening to someone talking just earlier about using a script and a localhosted LLM to organise and rename PDFs with author and title. If you can identify some kind of patterns (such as a heading that starts each document of a type) that you can detect, a script could find those pages and then feed that into something that will segment page ranges for each doc. It’s definitely possible but the patterns to look for will be determined by the docs you are looking at.

    • endless@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      ·
      6 hours ago

      I don’t have the volume where learning a completely new technology would be worthwhile. I would have to manually verify each one anyways because it has to be perfect. The documents do not have any format as nice as a heading at the top. I’m willing to put in the time to go through each page, I just need a fast way to tag them, then automate separation and renaming.

      • Sunsofold@lemmings.world
        link
        fedilink
        arrow-up
        3
        ·
        5 hours ago

        Hmm. Well, first off, if you mean you don’t know how to write a script and don’t view it as worth learning for this task, that limits the task a fair amount. If you mean you don’t want to learn about the particulars of script based PDF editing or OCR, that’s understandable.

        If you don’t want to script at all, you should be able to segment the PDFs via acrobat, or even just ‘print to PDF’ with page ranges on most viewers. There are ways of bulk renaming files once you have segmented them, even without scripting, though it’d be use case dependent as to whether/how that’d be useful to you.

        If you want to script just a little, I made a script ages ago where I used the documents’ name to hold the metadata of what needed to be modified. You could certainly do that. (e.g. open the doc in one window, select the file for renaming in your file explorer, scroll through and input the sequence of pages in the rename field, [documentName3,7,15,22,29.PDF] run a script to segment the PDF at those page numbers so you end up with ‘documentName-1.PDF’ containing pages 1 to 2, another with 3 to 6, etc.)

        A bit more effort could maybe be used to do some level of renaming, though how much use that would be would depend on the particulars of your case. I could see extending the previous script a little and making the page annotations include a doc type. (e.g. 13cn meaning segment at page 13 and label it as ‘originalDocumentName-clientNotification’, or even 13’arbitraryText’ and use the arbitrary text as the new file name)

        The particularity of your case may be precisely why it hasn’t been automated yet.

        • endless@lemmy.mlOP
          link
          fedilink
          arrow-up
          1
          ·
          4 hours ago

          I am not going to learn how to train an AI for this task. It is non trivial to install anything and I cannot use any remote/online tools. I would need to find an appropriate local AI (deepseek?) and learn how to use it from scratch.

          I could write a bash script to modify filenames at home on my linux machine. But at work I just have windows. It has… powershell? I guess. I’ve never used that and to be honest I have no desire to. I would have to install something to cut up the PDFs. ocrmypdf that could do everything. And there are various other cli PDF manipulation tools in the repos. I would have to ask to have it installed. And any other dependencies required. Not gonna happen.

          I want a way to easily go through hundreds of pages, look at them and quickly tag them. That is a perfect task for a GUI. To use a script I would have to scroll through the PDF in one application then switch back and forth into a text editor, to manually create a text document specifying which pages are in what document, and what category etc. I’d sooner do it on paper. But I’m sure there is a solution for this, I just don’t know what it is.

  • foggy@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    4 hours ago

    Am I understanding this that you have some number of .pdf files that are 40-60 pages each and within them, there exist documents varying from 2 to 10 pages, and your task is to parse them?

    If so, how many .PDFs are we talking here? You said on paper it’s like 8cm high? So like 1000 pages ish?

    So like 20 .PDFs?

    Just… Do it, dawg. The amount of time you spent on this post you coulda finished 1 of those PDFs. That’s 5% of the task. Do that 19 more times.

    If you’re asking “can Adobe Acrobat break a 60 page .pdf into some number of .PDFs based on page numbers I tell it to?” the answer is yes.

    Breathe a bit friend. No need to get overwhelmed.

    • endless@lemmy.mlOP
      link
      fedilink
      arrow-up
      3
      ·
      10 hours ago

      They print it out on paper, organize it with sticky notes and paper clips, then have someone re-scan it and name/organize files digitally according to the sticky notes. I don’t want to do it that way.