FROM : Frédéric Testuz
DATE : Mon Oct 18 21:15:06 2004
Le 18 oct. 04, à 19:59, Steven Kramer a écrit :
>
> Op 16-okt-04 om 18:11 heeft Frédéric Testuz het volgende geschreven:
>
>> Hello,
>>
>> I have a program to edit some data. Now I want to print the data in
>> different forms and I have think of the WebView. Create the html code
>> is not difficult and you can customize the style easily with css.
>> (And I have never draw things, so using a view who is doing the job
>> is easier :-)
>>
>> It's the first time I print something in a cocoa program. I have some
>> difficulties with the dimensions of the view.
>> I set the width with infos from the document printInfo, but for the
>> height I can't find a way to obtain the bound height of the view
>> which draw the html code. Here is my code:
>>
>
> ,
>
> Don't print the web view, print it's main frame. This also gives you
> big speedups and doesn't print the scrollers.
>
> NSView* printView = [[[webView mainFrame] frameView] documentView];
>
> Check the archives too, this has all been discussed before.
Thanks for your answer.
Meanwhile, I red the archives and already test this solution. It don't
work. I think the reason is that I create the WebView and I don't
include it in a window. So before [printOperation runOperation]
documentView is *nil*. Note that if you set the WebView for the
printOperation, documentView exists after runOperation.
Perhaps I hadn't see a good exemple in the archives, if someone has a
code exemple.
--
Frédéric Testuz
<mailto:<email_removed>>
DATE : Mon Oct 18 21:15:06 2004
Le 18 oct. 04, à 19:59, Steven Kramer a écrit :
>
> Op 16-okt-04 om 18:11 heeft Frédéric Testuz het volgende geschreven:
>
>> Hello,
>>
>> I have a program to edit some data. Now I want to print the data in
>> different forms and I have think of the WebView. Create the html code
>> is not difficult and you can customize the style easily with css.
>> (And I have never draw things, so using a view who is doing the job
>> is easier :-)
>>
>> It's the first time I print something in a cocoa program. I have some
>> difficulties with the dimensions of the view.
>> I set the width with infos from the document printInfo, but for the
>> height I can't find a way to obtain the bound height of the view
>> which draw the html code. Here is my code:
>>
>
> ,
>
> Don't print the web view, print it's main frame. This also gives you
> big speedups and doesn't print the scrollers.
>
> NSView* printView = [[[webView mainFrame] frameView] documentView];
>
> Check the archives too, this has all been discussed before.
Thanks for your answer.
Meanwhile, I red the archives and already test this solution. It don't
work. I think the reason is that I create the WebView and I don't
include it in a window. So before [printOperation runOperation]
documentView is *nil*. Note that if you set the WebView for the
printOperation, documentView exists after runOperation.
Perhaps I hadn't see a good exemple in the archives, if someone has a
code exemple.
--
Frédéric Testuz
<mailto:<email_removed>>
| Related mails | Author | Date |
|---|---|---|
| Frédéric Testuz | Oct 16, 18:11 | |
| Frédéric Testuz | Oct 18, 21:15 | |
| Steven Kramer | Oct 19, 13:58 |






Cocoa mail archive

