[Python] Automating PDF Renaming and Startup Execution for Invoice Management

Discussão em 'Python' iniciado por Stack, Setembro 26, 2024.

  1. Stack

    Stack Membro Participativo

    Context:

    I am working on a project where I need to automate the process of renaming PDF files of invoices. The Python code I am using monitors a specific folder (called "chegada de notas") and, when a new PDF is added, it extracts the company name contained in the PDF to rename it. The structure of the PDF includes a field "Nome/Razão Social" that appears between the fields "CPF/CNPJ" and "Endereço."

    However, I am facing two main problems:


    1. PDF Renaming: Despite adjusting the regular expression to search for the company name, the code often returns "Empresa_Desconhecida." What can I do to ensure that the company name is correctly extracted and used to rename the PDF?


    2. Automatic Execution on Startup: I would like this Python script to run automatically whenever Windows starts, but I am having trouble configuring this correctly. I have already created a .bat file that calls the script, but I am not sure if it is set up correctly in the Windows Startup folder.

    I appreciate any help in resolving these issues and getting the script to work properly!

    I tried everything but I don't know what to do

    Continue reading...

Compartilhe esta Página