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

Print to PDF failing #358

Closed
seanms opened this issue Jul 3, 2021 · 1 comment · Fixed by #360
Closed

Print to PDF failing #358

seanms opened this issue Jul 3, 2021 · 1 comment · Fixed by #360

Comments

@seanms
Copy link

seanms commented Jul 3, 2021

Steps to Reproduce

  1. Select a recipe.
  2. Print
  3. Select a network printer which accepts PDF.

Expected Behavior

Recipe prints.

Current Behavior

Attempt to print fails with:

Traceback (most recent call last):
File "/app/lib/python3.8/site-packages/gourmet/plugins/import_export/pdf_plugin/print_plugin.py", line 188, in begin_print
pe = pdf_exporter.PdfExporterMultiDoc(self.rd,self.recs,fn,pdf_args=self.args,
AttributeError: 'PDFRecipePrinter' object has no attribute 'args'

Possible Solution

The following diff works around the problem:

@@ -185,7 +185,7 @@

     def begin_print (self, operation, context):
         fn = tempfile.mktemp()
-        pe = pdf_exporter.PdfExporterMultiDoc(self.rd,self.recs,fn,pdf_args=self.args,
+        pe = pdf_exporter.PdfExporterMultiDoc(self.rd,self.recs,fn,
                                               change_units=self.change_units, mult=self.mult)
         pe.connect('error',self.handle_error)
         pe.run()

Environment

  • Operating System: Fedora 33
  • Version or commit id: 1.0.0
  • Installed as Flatpak or Python package?: flatpak
@cydanil
Copy link
Collaborator

cydanil commented Jul 4, 2021

Thank you for reporting the issue and taking time to propose a fix!

It makes sense, and that's what I went for 👍

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 a pull request may close this issue.

2 participants