Home > Software engineering >  Direction control about VC printing paper
Direction control about VC printing paper

Time:10-11

Now work on a project, after the data analysis to generate a report, report to the printer to print output, also can generate PDF documents, paper for A4, report page paper for the vertical direction, the rest of the page paper for the horizontal direction,
I use a VC document view structure processing report output, of course, if all report content paper direction is consistent, or all horizontal, vertical, or all need to reload the CView: : OnPreparePrinting (CPrintInfo * pInfo) :
If (pApp - & gt; GetPrinterDeviceDefaults (& amp; PInfo - & gt; M_pPD - & gt; M_pd))
{
ASSERT (pInfo - & gt; M_pPD - & gt; M_pd. HDevMode);
If (pInfo - & gt; M_pPD - & gt; M_pd. HDevMode==NULL)
PInfo - & gt; M_pPD - & gt; M_pd. HDevMode=GlobalAlloc (GHND, sizeof (DEVMODE));
ASSERT (pInfo - & gt; M_pPD - & gt; M_pd. HDevMode);
DEVMODE * product data management (PDM)=(DEVMODE *) GlobalLock (pInfo - & gt; M_pPD - & gt; M_pd. HDevMode);
Product data management (PDM) - & gt; DmOrientation=DMORIENT_LANDSCAPE;
Product data management (PDM) - & gt; DmFields |=DM_ORIENTATION;//determine the direction of paper
GlobalUnlock (pInfo - & gt; M_pPD - & gt; M_pd. HDevMode);
}

The question now is, the report page do not match the paper direction and the rest of the page, if the simple print, can be managed to two print to solve this problem, because to generate PDF documents, I use is pdfCreator virtual printer, if two print, will eventually generate two PDF file, of course, a report just a PDF file,
A printout, different page paper in a different direction, is there anyone who have programming experience in this field? Thank you very much!

CodePudding user response:

In the Word can is not the same as the direction of the paper, each page after Word2007 can save as PDF,

CodePudding user response:

Print on demand in the process of change the direction of the paper, I have found a solution, thank you!
  • Related