Changing size of view during NSPrintOperation?

  • In my app, I have a custom view which I'm printing.  The NSPrintPanel has an accessory panel attached with a couple of options on it that I'm observing using the NSPrintPanelAccessorizing method -keyPathsForValuesAffectingPreview.  That works fine.

    When the user changes some of the settings, the size (ie, frame) of the view changes (columns are added/removed from an NSTableView in my custom view).  When that happens, the preview doesn't get updated correctly: it uses the frame of the view as it was when the NSPrintOperation was created.  That means that the preview panel doesn't show the correct image of the page to be rendered.

    Is there a way to notify NSPrintOperation that the frame size has changed on the view to be printed?

    I've tried all sorts of fiddling with the frame and bounds of the view to try to get it to display to no avail.

    I'm really stuck so any help would be appreciated, as by my customer who is very frustrated at how long this detail has taken resolve.

    Thanks,

    Ben.
  • On 20/07/2012, at 12:06 AM, Ben Golding wrote:

    > In my app, I have a custom view which I'm printing.  The NSPrintPanel has an accessory panel attached with a couple of options on it that I'm observing using the NSPrintPanelAccessorizing method -keyPathsForValuesAffectingPreview.  That works fine.
    >
    > When the user changes some of the settings, the size (ie, frame) of the view changes (columns are added/removed from an NSTableView in my custom view).  When that happens, the preview doesn't get updated correctly: it uses the frame of the view as it was when the NSPrintOperation was created.  That means that the preview panel doesn't show the correct image of the page to be rendered.
    >
    > Is there a way to notify NSPrintOperation that the frame size has changed on the view to be printed?

    Is there not a property that you can touch when you change the columns, and add that property to what is returned by -keyPathsForValuesAffectingPreview? The property doesn't have to DO anything, it just has to be observed by the preview. As far as I can tell it's the only way to notify the print preview of changes that I've discovered.

    --Graham
previous month july 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today