Multipage printing

I am trying to do multipage printing with the MFC. I've already read 
"Printing: Multipage documents". OnPrint gets called for each page of
the document. The MFC help says to "move the viewport origin and the
clipping region to ensure that the appropriate portion of the document
gets printed." I am calling SetWindowOrg to change the origin, but the
MFC help skips explaining how to determine the origins.

Clearly, the origin is trivial for the first page, but the origin of
the second page depends on how much was printed on the first page. How
does one determine the size (I guess in pixels) of the size of the
paper?
0
BuffyToU (10)
9/11/2003 4:56:33 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
858 Views

Similar Articles

[PageSpeed] 23

I use this code:


  pDC->SetWindowOrg(pInfo->m_rectDraw.right, 0); //shifts origin 1 page
right

  pDC->SetWindowOrg(0, pInfo->m_rectDraw.bottom); //shifts origin 1 page
down


Vaclav


"Tammy" <BuffyToU@yahoo.com> p�se v diskusn�m pr�spevku
news:c7bd5687.0309110856.41e5a2d6@posting.google.com...
> I am trying to do multipage printing with the MFC. I've already read
> "Printing: Multipage documents". OnPrint gets called for each page of
> the document. The MFC help says to "move the viewport origin and the
> clipping region to ensure that the appropriate portion of the document
> gets printed." I am calling SetWindowOrg to change the origin, but the
> MFC help skips explaining how to determine the origins.
>
> Clearly, the origin is trivial for the first page, but the origin of
> the second page depends on how much was printed on the first page. How
> does one determine the size (I guess in pixels) of the size of the
> paper?


---
Odchoz� zpr�va neobsahuje viry.
Zkontrolov�no antivirov�m syst�mem AVG (http://www.grisoft.cz).
Verze: 6.0.517 / Virov� b�ze: 315 - datum vyd�n�: 8.9.2003


0
vjedlicka (4)
9/11/2003 7:21:30 PM
Thanks, that did the trick. You are a real life saver.

The print on the printer comes out OK. I seem to have a problem with
the print preview. My test document has 6 pages. In the print preview,
I can click the NEXT button to cycle through pages 1 & 2, then 2 & 3,
until I get to pages 5 & 6 displayed. I can then press the NEXT button
one more time to show page 6 only. At this point, the PREV button is
disabled, presumably because I said that there  were no more pages to
be printed. It seems that this is a bug, possibly in my code, but I
would have thought that the MFC code would have been smarter than
that.

"V�clav Jedlicka" <vjedlicka@iol.cz> wrote in message news:<#yU9p6JeDHA.3076@TK2MSFTNGP11.phx.gbl>...
> I use this code:
> 
> 
>   pDC->SetWindowOrg(pInfo->m_rectDraw.right, 0); //shifts origin 1 page
> right
> 
>   pDC->SetWindowOrg(0, pInfo->m_rectDraw.bottom); //shifts origin 1 page
> down
> 
> 
> Vaclav
> 
> 
> "Tammy" <BuffyToU@yahoo.com> p�se v diskusn�m pr�spevku
> news:c7bd5687.0309110856.41e5a2d6@posting.google.com...
> > I am trying to do multipage printing with the MFC. I've already read
> > "Printing: Multipage documents". OnPrint gets called for each page of
> > the document. The MFC help says to "move the viewport origin and the
> > clipping region to ensure that the appropriate portion of the document
> > gets printed." I am calling SetWindowOrg to change the origin, but the
> > MFC help skips explaining how to determine the origins.
> >
> > Clearly, the origin is trivial for the first page, but the origin of
> > the second page depends on how much was printed on the first page. How
> > does one determine the size (I guess in pixels) of the size of the
> > paper?
> 
> 
> ---
> Odchoz� zpr�va neobsahuje viry.
> Zkontrolov�no antivirov�m syst�mem AVG (http://www.grisoft.cz).
> Verze: 6.0.517 / Virov� b�ze: 315 - datum vyd�n�: 8.9.2003
0
BuffyToU (10)
9/12/2003 5:06:38 PM
Reply:

Similar Artilces:

printing envelope using current letter pulls in entire letter
I have a letter that was created in 97 and saved as 97-2003. When I try to print my envelope for the letter, the entire letter is pulled in and not just the address. If I create a new letter in 2003, it works fine. How can I use my 97 documents and print my envelopes? To print an attached envelope, put 0 as the page number or use s1 (for section 1) in the Pages box. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "sara b" <sarab@discussions.microsoft.com> wrote in message news:F0DDBD40-2AE1-49DD-B...

Printing all worksheet names
Does anyone know if it possible to print a list of worksheet names? A list similar to the one you would find in the "Contents" tab of the files' Properties. Thanks for any help you can provide. Programme - XP Excel Hi This topic was covered lately in microsoft.excel.worksheet.functions NG (thread 'print sheet tab names' started by JDB at 06.01.2004 16:00). Here is the solution from me: Create an UDF --- Public Function TabByIndex(TabIndex As Integer) As String Application.Volatile TabByIndex = Sheets(TabIndex).Name End Function --- On some empty worksheet,...

print labels
Can Excel print to an Avery label? If so, how do I do this? Thanks, Andre Not really, use mailmerge with Word http://www.mvps.org/dmcritchie/excel/mailmerg.htm -- Regards, Peo Sjoblom http://nwexcelsolutions.com "Andre" <no@spam.com> wrote in message news:OWveirddGHA.3484@TK2MSFTNGP04.phx.gbl... > Can Excel print to an Avery label? If so, how do I do this? > > Thanks, Andre > I have my names in Excel going across fname lname street etc. I then open Word and use mail wizard and follow it and give the excel file as its source Works great ...

Print Preview #4
I would like to preview my worksheets that contains coloured cells as they will print on a BW printer so I know what my charts etc. will actually look like. How do I turn off the Print Preview in colour when printing to a BW printer? i.e. I want to see exactly what will print depending on what printer I go to (the BW or the Colour). Further, I am not asking about the Page Setup option of checkmarking Black and White as that will print in only Black and White and not scale my colours and patterns accordingly to the % they would actually print. Please advise and thank you. Deborah ...

Printing Checks #4
Do I have to buy checks that already have my account and routing number printed to use Money 2003 Standard? Yes. "Tom P" <anonymous@discussions.microsoft.com> wrote in message news:06b601c3aef9$dc7264c0$a301280a@phx.gbl... > Do I have to buy checks that already have my account and > routing number printed to use Money 2003 Standard? ...

Bottom border line won't print in Word 2004 for Mac
Version: 2004 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel On the screen I can place a page border in Word 2004 for Mac document, but in Print Preview the bottom line of the border disappears. And, of course, when I print, the bottom line won't appear. It doesn't appear that any footer (which I don't want) is in the way of the margin that I have set. Any solution to this? See: http://word.mvps.org/faqs/formatting/BottomsDontPrint.htm Also confirm that you have the latest printer driver from the mfr's web site as well as all current updates for Offi...

printing a 50:1 scale plan
I'm trying to print a 50:1 scale plan of a large room on a sheet of A3 paper. If A3 is too small I can move up to a plotter if required. What I need to end up with is a physical printout that measures 2cm for every metre. I'm finding the number of different settings confusing - please could someone suggest the correct settings to me? ...

Printing a single form which has tabs
Hello I have created a form in which I am inputting survey data. There are 5 tab pages in this form. I want to print all 5 tabbed pages. I want to create a button called "Print Record". When one clicks on this button, I want it to print all 5 pages. At the moment, I print one page. Then tab to the second page and print, and so. Can I set it so that one you click on print, you can decide on which page you want to print or print all five pages? Can I do this in code? If this isn't the right section, please direct me. Thank you in advance. Generally spea...

Where is print preview in Word 2010
I'm lost - where under print do I find print preview? cb4134 wrote: > I'm lost - where under print do I find print preview? Click the File tab and click Print, or just press Ctrl+P. The entire right side of the screen shows the print preview. In fact, unless you put the Quick Print button on the Quick Access Toolbar and use that, you can't avoid the print preview. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. Jay seems to be re...

Text and backgound do not print
I have created a folding leaflet which appears fine on the screen. However, when I click on print preview, half of the leaflet appears only as a white space. When I print it, I get the same result, i.e. only half of it appears on the page. Can anyone help, please? Try running Design Checker on your leaflet. Sometimes issues will show up that that prevent items from being printed. I just helped a woman with a very similar issue. I deleted some extra text boxes and it's fine. ;-) -- JoAnn Paules MVP Microsoft [Publisher] ~~~~~ How to ask a question http://support.microsoft.com/...

Printing landscape worksheets with footer on left
I know that I must not be the first person to have this problem, but I cannot find a solution. I have a workbook that has 20 worksheets. The orientation varies between portrait and landscape. I need the landscape worksheets to print with the footer on the "left" side, so that when I put the entire report (workbook) together for presentation, all of the footers are on the bottom, like a book. I have tried merging the first column (A) and making it the footer with the font facing left, but it is difficult to make them print evenly on each sheet. I have also tried to cop...

Print bcc's on copy of sent message?
If *I* send a message and blind copy someone on it, is there any way to get Outlook to print the bcc recipients? Right now I'm having to handwrite the bcc's on my file copy. Would love it if Outlook would automatically print this. ...

Print to a file
My program has some methods that print to a printer OK. But I need to put labels on those files afterwards so it would be better to print them to a file first. The program calls GetPrinterDC() before starting the printing. Is there some update that will permit the user to print to a file? Thanks, E-Jo Hello E-Jo, Glad to see you. Generally speaking, if you want to save and add the information in current dc to a file, you can create a dc from a bmp and blt all informaiton from the src dc to the bmp. I notice you would like to put labels on a file after it is printed. I am afraid I...

Access 2000:Print settings keep changing
I have created reports and saved the margins and column settings. But, I always get a call from co-workers stating these settings are messed up. These settings will be great for a number of days, and then they get changed. I have often wondered if one of the users is doing an "oops" and resetting those certain reports back to default, or is there a bug that might be causing this? This is a small office and I really don't think this is a malicious event. On Tue, 8 May 2007 20:44:01 -0700, ctuck61 wrote: > I have created reports and saved the margins and column setti...

Epson Stylus NX515 does not print, not even a Test page
I use Windows 7 and the Epson Stylus NX515 is on and the wireless light is also on. But it does not print. The documents are in the queue but do not print. Not even a test page. Here is a link to Epson trouble shooting site. Make sure when you want to print you pick your printer if there is a list of printers. "Ritter197" wrote: > I use Windows 7 and the Epson Stylus NX515 is on and the wireless light is > also on. But it does not print. The documents are in the queue but do not > print. Not even a test page. > > . > http://www.epson.com...

Print Button
On my summary tab, I want to add a print button command that will print the entire work book if the button is pushed. How do I add the print button? Hi, First do the print setup for all the tabs then write a macro to print each tab create a button in summary sheet using toolbox assign the macro to this button Ratheesh ...

Opening address book in Word to print labels & envelopes
When I try to open the address book in Word to print labels, I get a notice to log onto Microsoft Exchange. I do not understand what to do??? Post your Outlook version. Post the mail accounts you have configured for Outlook. State whether you have added the Outlook Address Book to your Outlook Profile. -- Russ Valentine [MVP-Outlook] "Dolores" <fischere@midwestis.net> wrote in message news:25BF4DED-58CC-49B5-8DD0-2D8482BE6BC2@microsoft.com... > When I try to open the address book in Word to print labels, I get a notice to log onto Microsoft Exchange. I do not understand...

Can you print specific worksheets?
Hi everyone, I have 15 worksheets in my workbook, but i just want to print specific worksheets. Is it possible to specify which worksheets you want to print to save me having to print the whole workbook? Many thanks, Rodney You can print each sheet individually (15 separate print) or Select the sheets (click on the first sheet and ctrl-click on the subsequent sheets) then File|Print Rodney wrote: > > Hi everyone, > > I have 15 worksheets in my workbook, but i just want to print specific > worksheets. Is it possible to specify which worksheets you want to print to > ...

Excel 2002 Column Widths & Printing
Excel column widths are starting to confuse me! I have a workbook containing several sheets. The sheets are not identical and have differing numbers of columns, e.g. some sheets have 9 columns, whilst others have 11 or 14. The margins for each sheet are exactly the same with 0 set for header and footer. The printer setup for each page calls for 100% normal size, A4, 1 page wide by 1 page tall. The correct print area is set for each sheet. The various column widths for each sheet, when added together, are identical (86 units in this case, although what the 'units' are, I do n...

How do you print one address label at a time on avery 5160 labels.
I'll bet you have partial sheets of labels. I know that's why I have to use a work-around. You'll have to use a template of the entire sheet, not the wizard. 1. Go to http://publishermvps.com/Default.aspx?tabid=38 2. Download the template for Avery 5160 labels. 3. Create the label you want. 4. Print said label. 5. Thank Brian for saving you A LOT of time and work. (I've been known to lay my label out in Publisher and then copy and paste it into a Word document.) -- JoAnn Paules MVP Microsoft [Publisher] "sharonm" <sharonm@discussions.microsoft.com&...

Userform
Hi all I have a problem I am using the following code, Private Sub cmdPrint_Click() frmOrders.PrintForm End Sub How is it possible to get the userform to be printed in landscape Thanks in advance Greg Greg, You could throw up a print dialog and allow the user to select landscape (and even the printer if required), and then print after, something like Private Sub cmdPrint_Click() Dim fOK As Boolean Dim sPrinter As String With Application sPrinter = .ActivePrinter fOK= .Dialogs(xlDialogPrinterSetup).Show End With If fOK= Then frmOrders.PrintForm...

Printing certian events
How do I print a calendar with only certian events instead of a calendar with all events and appointments. For example if I want to print a calendar with only Business events? You could Filter the view first, or use Find, depending on what kind of calendar and time frame you were printing. Matt Lujano wrote: > How do I print a calendar with only certian events instead of a calendar with > all events and appointments. For example if I want to print a calendar with > only Business events? Create a filter that shows only items in the Business category. -- Dia...

Text colours printing wrong
(Publisher 2003 and Windows XP). I have just installed Office Professional and am trying to use Publisher 2003. However the printed text colours do not match the design colours at all making it totally useless! Fills and pictures are ok. It is as if each font color is being translated to a new colour. This is easily seen in Print Preview. Even when I us a supplied template without modification this happens. Tried different colour schemes with similar results. Example in the Nutmeg scheme a dark crimson prints as a bright flame red and the khaki prints as bright yellow. If I convert to a web pa...

missing characters in printed copy
i created a mail merge document. just plain text with one single image(signature on letter). after completing/printing the job. we just realized that some characters are missing within the body of the letter. i cant figure out what seems to be or root of the problem. i tried to save the same exact document to previous version..(97-2003) and then tried to print a couple of sheets....it looks perfect. can somebody gave me info what may have caused that problem? here's some additional info: o.s. xp word 2007 printer : canon ir110 using pcl driver note: used the same fl...

print spool large files
When we send a print job to our color laser printer, the original job is 67MB but it gets blown up after we send it to the printer to over 2GB. This makes the print job take forever to print the 10 page brochure. We have tried new drivers and different printers and we have all service packs installled. Thanks for any help that you may offer. Tony How to troubleshoot problems that you may experience when you try to print to a local printer by using Office programs in Windows XP http://support.microsoft.com/kb/870622/en-us Can you add RAM to your printer? Have you looked at the printe...