Print Webview == Cropped content after changing scaleUnitSquareToSize

I used the code below to emulate Safari's ability to scale a web page:

-(IBAction)changeScale:(NSControl *)sender {
    [[[[wv mainFrame] frameView] documentView] setBounds:[self originalBounds]];
    [[[[wv mainFrame] frameView] documentView] scaleUnitSquareToSize:NSMakeSize([sender floatValue], [sender floatValue])];
    [[[[wv mainFrame] frameView] documentView] setNeedsDisplay:YES];
 }

The problem I am facing is that when I print after zooming out and the content is smaller, it doesn’t repair: the document originally containing 4 pages is still 4 pages, but the pages are only partially full. My expectation is that the pages will be narrower and also use the full height of the paper.

To print, I use this:

[[[[wv mainFrame] frameView] documentView] print:sender];

Thoughts?

Thank! Woody


: WWDC, , .;) , webview. " ", "", / PDF .

.

+3
1

.

0

Source: https://habr.com/ru/post/1745875/


All Articles