krithika wrote: > On Mar 29, 12:22 pm, Eli Friedman <[EMAIL PROTECTED]> wrote: >> There's some code that does some stuff similar to what you're asking in >> nsPrintEngine::GetPageRangeForSelection. You can use >> nsIPresShell::GetPrimaryFrameFor to get the primary frame for a content >> node, and nsIFrame::GetContent to get the content for a frame. Note >> that one piece of content may correspond to multiple frames, so things >> can get a bit complicated in some cases. >> >> -Eli > > > Hi, > > Iam still not clear.Can you clarify the following for me? > > 1. Do you mean to say I should not be doing stuff in nsDocumentViewer > printpreviewnavigate method?If yes where exactly will I get the > presShell corresponding to printpreview page contents.
I wasn't attempting to make any suggestion as to where you should be doing stuff; I was just suggesting you read the code in nsPrintEngine::GetPageRangeForSelection because it seemed like it might be helpful. > 2. The problem in the code I presented is that if I do a rootFrame > GetContent() it is null.GetPrimaryFrame requires content. Yeah; what are you trying to do? You can get the root content off of an nsIDocument or nsIDOMDocument, and call GetPrimaryFrameFor on that. >>From your ealier mail I was hoping to get the page starting element > easily. > > Iam clueless please help. > > regards, > Krithika > > > > > _______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

