Skip to main content
Question

Is it possible using FME / Python to detect a number in a PDF file and copy that number to the file name of the PDF and change it accordingly? Subsequently write the PDF file with the changed file number as output and save it on a specified location.


sc1
Contributor
Forum|alt.badge.img+2
  • Contributor

The number always begins in the PDF file with "Registratienummer: the number I want to copy"

3 replies

kailinatsafe
Safer
Forum|alt.badge.img+21

Hello @sc1​, thanks for posting! Sorry for not reaching out sooner, did you manage to get started on the process? FME and Python are likely both capable of this, but I think FME will work just fine. Are all of the PDF's your looking to process formatted similarly? or does formatting vary?

Take a look at this Getting Started with Reading PDF in FME article. Depending on if the data is spatial or non-spatial, you can use various PDF Reader parameters to control which text is interpreted as features. Nonetheless, happy to take a look if you're able to share a sample file. Best, Kailin.


sc1
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • September 11, 2023

Hi Kailin, thanks for your reply. All the PDF’s are formatted in a similar way and are non spatial. Does the above work as well with non spatial pdf’s or do I have to program a custom script?

 

kind Regards,

Sibe


kailinatsafe
Safer
Forum|alt.badge.img+21
sc1 wrote:

Hi Kailin, thanks for your reply. All the PDF’s are formatted in a similar way and are non spatial. Does the above work as well with non spatial pdf’s or do I have to program a custom script?

 

kind Regards,

Sibe

Hello @sc1​, that's great news! Yes, the PDF Reader supports both spatial and non spatial PDFs, so not to worry. I've included a screenshot highlighting the Non-Spatial parameters available on the PDF Reader:

 

PDFReader_nonspatialparametersFeel free to reach out if there are any issues reading your data into FME Form. Best, Kailin.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings