コード例 #1
0
 def PrintDocument(self, document, tofile=0):
     bbox = document.BoundingRect(visible=0, printable=1)
     if bbox is None:
         msgDialog(
             self.mw.root,
             title=_("Printing"),
             message=_(
                 "The document doesn't have \n any printable layers!\n"))
         return
     ############ --->
     if tofile:
         directory = config.preferences.dir_for_vector_export
         filename = document.meta.filename[:-4] + '.pdf'
         filename, pdffile = dialogman.getGenericSaveFilename(
             _("Print into PDF file"),
             pdf_types,
             initialdir=directory,
             initialfile=filename)
         if filename == '': return
         dlg = ProgressDialog(self.mw.root, 'PDF generation')
         dlg.RunDialog(self.print_tofile_callback, document, pdffile)
     else:
         dlg = ProgressDialog(self.mw.root, 'PDF generation')
         command, pdffile = dlg.RunDialog(self.print_callback, document)
         os.system(command)
コード例 #2
0
ファイル: docmanager.py プロジェクト: sk1project/sk1-tk
 def ExportPNG(self, document):
     directory = config.preferences.dir_for_bitmap_export
     filename = document.meta.filename[:-4] + ".png"
     filename, pngfile = dialogman.getGenericSaveFilename(
         _("PNG export"), png_types, initialdir=directory, initialfile=filename
     )
     if filename == "":
         return
     fileformat = filters.guess_export_plugin(".png")
     saver = filters.find_export_plugin(fileformat)
     saver(document, pngfile)
コード例 #3
0
 def ExportPNG(self, document):
     directory = config.preferences.dir_for_bitmap_export
     filename = document.meta.filename[:-4] + '.png'
     filename, pngfile = dialogman.getGenericSaveFilename(
         _("PNG export"),
         png_types,
         initialdir=directory,
         initialfile=filename)
     if filename == '': return
     fileformat = filters.guess_export_plugin('.png')
     saver = filters.find_export_plugin(fileformat)
     saver(document, pngfile)
コード例 #4
0
ファイル: docmanager.py プロジェクト: sk1project/sk1-tk
 def PrintDocument(self, document, tofile=0):
     bbox = document.BoundingRect(visible=0, printable=1)
     if bbox is None:
         msgDialog(
             self.mw.root, title=_("Printing"), message=_("The document doesn't have \n any printable layers!\n")
         )
         return
         ############ --->
     if tofile:
         directory = config.preferences.dir_for_vector_export
         filename = document.meta.filename[:-4] + ".pdf"
         filename, pdffile = dialogman.getGenericSaveFilename(
             _("Print into PDF file"), pdf_types, initialdir=directory, initialfile=filename
         )
         if filename == "":
             return
         dlg = ProgressDialog(self.mw.root, "PDF generation")
         dlg.RunDialog(self.print_tofile_callback, document, pdffile)
     else:
         dlg = ProgressDialog(self.mw.root, "PDF generation")
         command, pdffile = dlg.RunDialog(self.print_callback, document)
         os.system(command)