krithika wrote: > I tried looking in to nsPrintEngine.cpp code and the routine you > mentioned.But Iam finding this quite complex. > > preShell I get maps only to the document or frames of the document.Iam > unable to make any progress. > > My experiments with nsDocumentViewer:PrintPreviewNavigate is also > failing to give me the preview page content. > > Which is the point at which a document is split in to pages as in > Print Preview?I need to hook in at that point.
Hmm, first off, are you using a trunk build? Some stuff has changed a bit there, so that you'll have to get the prescontext from the printengine. The place where the page splits actually get calculated is the call to InitialReflow in nsPrintEngine::ReflowPrintObject. If you have a debug build, the functions in nsIFrameDebug might be useful. Quick approximate summary of the frame tree for print preview: the root frame is the viewport. The only child of that is the root scroll frame. The only child of that is the page sequence frame. The children of that are the page frames. Each page frame has one child, an nsPageContentFrame. The page content frame contain the content on each page. The most common frames are nsBlockFrame, nsInlineFrame, and nsTextFrame, which get created for normal textual content. When a content element doesn't fit on one page, the frame gets split. Therefore, a content node can have frames on multiple pages. The splitting happens during reflow. The frame tree is a bit confusing to get used to, so try not to get frustrated. -Eli _______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

