Persist printer settings between prints

Issue #4 new
Alastair McBain repo owner created an issue

This may not be possible (or at least easily so) if the effect is reinitialized every time it is used. I believe it is because of my ability to make changes and select the extension again to see them without restarting Inkscape. My guess is it just creates a new Python process and waits for it to finish or write out its results.

Comments (1)

  1. Alastair McBain reporter

    There's no signal to decommission/close down an effect and changes to the script show up with the next run, so I'm absolutely sure it's instantiated every time. Thus keeping around a copy of the DEVMODE structure in memory is not a viable option. Also the structure makes things hard on us by supplying the private printer settings data after the end of the structure.

    If such data could be extracted, it could be saved as a binary temp file somewhere to be loaded again later. (Which I think Inkscape has locations for and may clean up for us on close.) However this means we have to allocate more space than needed for the structure to put such information back in, and I'm unsure how to do this in Python. Not only that, but when I tried supplying the DEVMODE structure, the call to open the print dialog would only work one out of ten to twenty attempts or so, crashing on user acceptance of the dialog (and taking the running Python script with it).

  2. Log in to comment