Skip to content

Ask user the number of copies to print#1213

Merged
andi34 merged 12 commits intoPhotoboothProject:devfrom
fmiccolis:feature/multiple-prints
Oct 14, 2025
Merged

Ask user the number of copies to print#1213
andi34 merged 12 commits intoPhotoboothProject:devfrom
fmiccolis:feature/multiple-prints

Conversation

@fmiccolis
Copy link
Copy Markdown
Contributor

Prerequisites checklist

What is the purpose of this pull request? (put an "x" next to an item)

  • Documentation update
  • Bug fix
  • New feature
  • Other, please explain:

What changes did you make? (Give an overview)

I've added a new setting to let the user choose how many copies to print when pressing the button in the result page and in the gallery. Referring to this request #1169

Is there anything you'd like reviewers to focus on?

nothing

@andi34
Copy link
Copy Markdown
Contributor

andi34 commented Aug 25, 2025

Hey and thanks a lot!
Should we pass $vars['copies'] as second argument inside api/print.php?
lp... %s -n %s ?
Else everyone would need to adjust his/her print command and also not sure if it's working on windows

@fmiccolis
Copy link
Copy Markdown
Contributor Author

Do you mean that instead of let the users update their own commands in the admin page we should always add at the end of the command " -n %d" in the api/print.php?
In the case of Windows I have to find the right piece of command to add to make it work.

The alternative will be to manage the copies in the js frontend by calling photoboothTools.printImage() for each time the value of copies. In this way even if someone has a complete custom command to print the image should continue to work

@andi34
Copy link
Copy Markdown
Contributor

andi34 commented Aug 26, 2025

I've not tested yet. Was thinking about the impact of line to the print command.

$cmd = sprintf($config['commands']['print'], $vars['copies'], $vars['printFile']);

Which would result on lp %s to lp 1 instead of lp /path/to/image.jpg or not?

@fmiccolis
Copy link
Copy Markdown
Contributor Author

To test in my enviroment I've updated the default print command from
lp -o landscape -o fit-to-page %s to lp -o landscape -o fit-to-page -n %d %s
so in my case the final command will be something like lp -o landscape -o fit-to-page -n 1 /path/to/image.jpg

But I forgot to update it into the PhotoboothConfiguration.php. Right now I don't know if we want to make this feature "required" and so update every print command to host the number of copies parameter and tell the users to check theirs commands

@andi34
Copy link
Copy Markdown
Contributor

andi34 commented Aug 26, 2025

If the "old" lp %s still works, no need to automatically Update anything for users.
If %d is not passed and doesn't hurt if it's missing I am fine with it. Else we'll have to make sure the initial print setup still works.

@fmiccolis
Copy link
Copy Markdown
Contributor Author

Ok, I'll test more with these combinations and let you know the results.

Comment thread api/print.php
@andi34
Copy link
Copy Markdown
Contributor

andi34 commented Oct 2, 2025

Hey @fmiccolis !
Did you had time to test my adjustments of the code?

@fmiccolis
Copy link
Copy Markdown
Contributor Author

fmiccolis commented Oct 2, 2025

Hi @andi34 , I've tested my initial version in a real scenario and it worked as expected.
I still have to test the latest commits you pushed on the branch

@andi34 andi34 merged commit 2b9dd8b into PhotoboothProject:dev Oct 14, 2025
9 checks passed
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.

2 participants