Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch processing #2

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

xCatalitY
Copy link

Summary

This pull request introduces a new feature to the pdf-slides-utils that enables the script to automatically process all PDF files in the current directory. This enhancement eliminates the need to manually specify each file, significantly streamlining the workflow for users dealing with multiple PDFs.

Changes Made

  • Modified pdfdeanimate-image.py to iterate over all .pdf files in the current directory.
  • Incorporated a function process_pdf(pdffile) which encapsulates the existing logic for processing a single PDF file.
  • The script now applies this logic to each PDF found, automating the process of converting and reducing pages.

Impact

  • Users can now process multiple PDF files in one go, without the need to run the script separately for each file.
  • This feature is particularly useful for batch processing scenarios, where users have a collection of PDF files that require uniform processing.
  • It simplifies the user experience and enhances the utility of the script.

Testing

The updated script has been tested with various PDF files to ensure reliability and consistent performance. All tests indicate that the script processes each file in the directory as expected, maintaining its functionality and efficiency.

Looking forward to your feedback and any further suggestions for improvement!

@schokotets
Copy link
Owner

Hi, thanks for the pull request! I'm sorry, I must've missed it.

Would you mind removing the .idea directory from the commit and making it compatible with the changes in #3?

@milan-tom
Copy link
Contributor

I think it would also be good if this were a command line option rather than the default behaviour.

@schokotets
Copy link
Owner

could default shell expansion be sufficient already?

@xCatalitY
Copy link
Author

To run the script, you can use the following commands:

  • To process specific PDF files:

    python pdfdeanimate-image.py file1.pdf file2.pdf
    
  • To process all PDF files in the current directory:

    python pdfdeanimate-image.py
    
  • To use shell expansion and process multiple PDF files:

    python script.py *.pdf
    

@milan-tom
Copy link
Contributor

This looks very useful. However, it reverts the changes implemented in #3 and #5. It shouldn't be too hard to make them compatible though.

@xCatalitY
Copy link
Author

Thanks for the review. I now changed it.

Copy link
Contributor

@milan-tom milan-tom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sill reverting changes from #5. I think it will be easiest if you get the latest version of the script in main and make your changes on top of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants