• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Printing with a WebView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing with a WebView


  • Subject: Re: Printing with a WebView
  • From: Frédéric Testuz <email@hidden>
  • Date: Mon, 18 Oct 2004 21:15:06 +0200

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@hidden>

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Printing with a WebView
      • From: Steven Kramer <email@hidden>
References: 
 >Printing with a WebView (From: Frédéric Testuz <email@hidden>)

  • Prev by Date: Re: Building without depencies to Frameworks
  • Next by Date: Re: Crazy CFPreferences!
  • Previous by thread: Printing with a WebView
  • Next by thread: Re: Printing with a WebView
  • Index(es):
    • Date
    • Thread