Python Forum
Initializing a PRINTDLG structure-how to
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Initializing a PRINTDLG structure-how to
#1
I am trying to find documentation (in python) on how to initialize windows PRINTDLG and pass the structure to PrintDlg.
Thanks for any help.
Reply
#2
Not a Windows user here, but obviously it exists somewhere in Mark Hammond's pywin32 module.
Reply
#3
What GUI are you using? QT has some nice printer dialog management tools...
Reply
#4
I am using Kivy as a GUI. In the app i am running/displaying some data table sorts. As an afterthought I wanted to give the user the ability to print out their search so I save data in a text file and have a simple print command for either a Linux or WIn platform to print out.

def print_to_screen(self,instance):
try:
if platform=='linux':
os.system('lp -o media=letter -o fit-to-page -o landscape search.txt')
if platform=='win':
os.startfile("search.txt", "print")

The command for Linux is satisfactory for now however in Windows I need to either fit-to-page or change to landscape. I am inexperienced in printing and have not found a way on the windows os print command to add the landscape requirement.
Being inexperienced, I thought the Windows system already had a Print Dialogue and Page Setup Dialogue that I could just call from my app and feed it my text file and the user could modify as needed vs. using above.

So for now if I could just get above to print in landscape I could get by.
Printing looks like it can get involved.
Thanks to all.
Reply
#5
Sorry, found answers in wxPython and PyQt but not Kivy. Perhaps someone else...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Auto-py-to-exe Stuck At 'Initializing' killingtime 5 7,004 Jan-21-2024, 10:52 PM
Last Post: ShiDari
  "unexpected keyword arg" when initializing my subclasses Phaze90 3 3,145 Nov-25-2022, 07:39 PM
Last Post: Gribouillis
  Syntax when initializing empty lists Mark17 2 1,364 Jun-02-2022, 04:09 PM
Last Post: Mark17
  Initializing, reading and updating a large JSON file medatib531 0 1,775 Mar-10-2022, 07:58 PM
Last Post: medatib531
  Self re-initializing variable? python_user_n 6 3,205 May-03-2019, 02:52 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020