strange difference in print preview of vertical strings and ...

Hi,
I do not know if I have been doing a funny mistake , or there is a bug.
There is something very strange  when I textout a vertical string with
leading spaces in print preview mode.
I put an small example to show it:

try this:
make a multiple document, with CScrollView , (vc 6)
changes the following functions, the result of the 2 textout are not in the
same x position in print preview display. Each space at the beginning of
"profiles" shifts the output to right!!! but the x position of both should
be the same.
Off course it is ok on the screen and on the printer. Only the print preview
is wrong.

Does anybody have an idea ?

thanks,
   Behzad

void CTestfView::OnDraw(CDC* pDC)
{
 CTestfDoc* pDoc = GetDocument();
 ASSERT_VALID(pDoc);
 // TODO: add draw code for native data here
 CFont F1;

F1.CreateFont(600,300,-900,0,900,false,false,0,ANSI_CHARSET,OUT_DEFAULT_PREC
IS,
 CLIP_DEFAULT_PRECIS,DRAFT_QUALITY,DEFAULT_PITCH |
 FF_SWISS,"CG Times");
 CFont *F0=pDC->SelectObject(&F1);
 pDC->SetBkMode(TRANSPARENT);
 pDC->TextOut(2000,-5000,"Profiles"); // word1
 pDC->TextOut(2000,-7800,"   Profiles"); // word2
 pDC->SelectObject(F0);
}


void CTestfView::OnInitialUpdate()
{
 CScrollView::OnInitialUpdate();

 CSize sizeTotal;
 // TODO: calculate the total size of this view
 sizeTotal.cx = 20000;sizeTotal.cy = 20000;
 SetScrollSizes(MM_HIMETRIC, sizeTotal);
}



0
behzadvc1 (15)
12/10/2003 10:52:53 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
389 Views

Similar Articles

[PageSpeed] 39

I can't really figure out why it's doing what it's doing! But I do have a
suggestion. They say that using DrawText is a better way to go (That's all I
have been using for the last 15 years, and been happy with it).

Ali R.

"behzad" <behzadvc@yahoo.com> wrote in message
news:%23HSmfAxvDHA.1764@TK2MSFTNGP10.phx.gbl...
> Hi,
> I do not know if I have been doing a funny mistake , or there is a bug.
> There is something very strange  when I textout a vertical string with
> leading spaces in print preview mode.
> I put an small example to show it:
>
> try this:
> make a multiple document, with CScrollView , (vc 6)
> changes the following functions, the result of the 2 textout are not in
the
> same x position in print preview display. Each space at the beginning of
> "profiles" shifts the output to right!!! but the x position of both should
> be the same.
> Off course it is ok on the screen and on the printer. Only the print
preview
> is wrong.
>
> Does anybody have an idea ?
>
> thanks,
>    Behzad
>
> void CTestfView::OnDraw(CDC* pDC)
> {
>  CTestfDoc* pDoc = GetDocument();
>  ASSERT_VALID(pDoc);
>  // TODO: add draw code for native data here
>  CFont F1;
>
>
F1.CreateFont(600,300,-900,0,900,false,false,0,ANSI_CHARSET,OUT_DEFAULT_PREC
> IS,
>  CLIP_DEFAULT_PRECIS,DRAFT_QUALITY,DEFAULT_PITCH |
>  FF_SWISS,"CG Times");
>  CFont *F0=pDC->SelectObject(&F1);
>  pDC->SetBkMode(TRANSPARENT);
>  pDC->TextOut(2000,-5000,"Profiles"); // word1
>  pDC->TextOut(2000,-7800,"   Profiles"); // word2
>  pDC->SelectObject(F0);
> }
>
>
> void CTestfView::OnInitialUpdate()
> {
>  CScrollView::OnInitialUpdate();
>
>  CSize sizeTotal;
>  // TODO: calculate the total size of this view
>  sizeTotal.cx = 20000;sizeTotal.cy = 20000;
>  SetScrollSizes(MM_HIMETRIC, sizeTotal);
> }
>
>
>


0
nospam7515 (2084)
12/10/2003 5:39:26 PM
Behrooz Jan,

DrawText works with Vertical text too. I got it working with your sample
code. It just takes a little bit to get the Rect just right, specially in
metric mode, it works alot better in MM_TEXT mode, well everything works
alot better in MM_TEXT mode LOL ;)
No, I haven't been using MFC the entire time. I started windows programming
using borland C++ (SDK and OWL) back in 1990, all the way up to 1994, (I was
working with beta version of win95 and the Borland compiler wasn't
supporting it yet) and I switched to microsoft VC++ (MFC), and never looked
back. So I guess it has only been 14 years.

rasti emailam hast ali__2@yahoo.com, harmogeh kari chizi dashti bego, be
tarof

Ali

"behzad Nazari" <behzadvc@yahoo.com> wrote in message
news:%23EtIrC2vDHA.2492@TK2MSFTNGP12.phx.gbl...
> mamnun ali,
> Then there is that bug really. It realy took me a few hours to get this
bug!
> I fixed it indirectly, but it is really strange for me this behavour!
> but there is a problem, DrawText works only with horizontal texts, by the
> way u had been using MFC for 15 years ;)
>
> thanks,
>   Behzad
>
> "Ali R." <nospam@nospam.com> wrote in message
> news:iTIBb.382$_l1.131723387@newssvr11.news.prodigy.com...
> > I can't really figure out why it's doing what it's doing! But I do have
a
> > suggestion. They say that using DrawText is a better way to go (That's
all
> I
> > have been using for the last 15 years, and been happy with it).
> >
> > Ali R.
> >
> > "behzad" <behzadvc@yahoo.com> wrote in message
> > news:%23HSmfAxvDHA.1764@TK2MSFTNGP10.phx.gbl...
> > > Hi,
> > > I do not know if I have been doing a funny mistake , or there is a
bug.
> > > There is something very strange  when I textout a vertical string with
> > > leading spaces in print preview mode.
> > > I put an small example to show it:
> > >
> > > try this:
> > > make a multiple document, with CScrollView , (vc 6)
> > > changes the following functions, the result of the 2 textout are not
in
> > the
> > > same x position in print preview display. Each space at the beginning
of
> > > "profiles" shifts the output to right!!! but the x position of both
> should
> > > be the same.
> > > Off course it is ok on the screen and on the printer. Only the print
> > preview
> > > is wrong.
> > >
> > > Does anybody have an idea ?
> > >
> > > thanks,
> > >    Behzad
> > >
> > > void CTestfView::OnDraw(CDC* pDC)
> > > {
> > >  CTestfDoc* pDoc = GetDocument();
> > >  ASSERT_VALID(pDoc);
> > >  // TODO: add draw code for native data here
> > >  CFont F1;
> > >
> > >
> >
>
F1.CreateFont(600,300,-900,0,900,false,false,0,ANSI_CHARSET,OUT_DEFAULT_PREC
> > > IS,
> > >  CLIP_DEFAULT_PRECIS,DRAFT_QUALITY,DEFAULT_PITCH |
> > >  FF_SWISS,"CG Times");
> > >  CFont *F0=pDC->SelectObject(&F1);
> > >  pDC->SetBkMode(TRANSPARENT);
> > >  pDC->TextOut(2000,-5000,"Profiles"); // word1
> > >  pDC->TextOut(2000,-7800,"   Profiles"); // word2
> > >  pDC->SelectObject(F0);
> > > }
> > >
> > >
> > > void CTestfView::OnInitialUpdate()
> > > {
> > >  CScrollView::OnInitialUpdate();
> > >
> > >  CSize sizeTotal;
> > >  // TODO: calculate the total size of this view
> > >  sizeTotal.cx = 20000;sizeTotal.cy = 20000;
> > >  SetScrollSizes(MM_HIMETRIC, sizeTotal);
> > > }
> > >
> > >
> > >
> >
> >
>
>


0
nospam7515 (2084)
12/10/2003 10:06:17 PM
mamnun ali,
Then there is that bug really. It realy took me a few hours to get this bug!
I fixed it indirectly, but it is really strange for me this behavour!
but there is a problem, DrawText works only with horizontal texts, by the
way u had been using MFC for 15 years ;)

thanks,
  Behzad

"Ali R." <nospam@nospam.com> wrote in message
news:iTIBb.382$_l1.131723387@newssvr11.news.prodigy.com...
> I can't really figure out why it's doing what it's doing! But I do have a
> suggestion. They say that using DrawText is a better way to go (That's all
I
> have been using for the last 15 years, and been happy with it).
>
> Ali R.
>
> "behzad" <behzadvc@yahoo.com> wrote in message
> news:%23HSmfAxvDHA.1764@TK2MSFTNGP10.phx.gbl...
> > Hi,
> > I do not know if I have been doing a funny mistake , or there is a bug.
> > There is something very strange  when I textout a vertical string with
> > leading spaces in print preview mode.
> > I put an small example to show it:
> >
> > try this:
> > make a multiple document, with CScrollView , (vc 6)
> > changes the following functions, the result of the 2 textout are not in
> the
> > same x position in print preview display. Each space at the beginning of
> > "profiles" shifts the output to right!!! but the x position of both
should
> > be the same.
> > Off course it is ok on the screen and on the printer. Only the print
> preview
> > is wrong.
> >
> > Does anybody have an idea ?
> >
> > thanks,
> >    Behzad
> >
> > void CTestfView::OnDraw(CDC* pDC)
> > {
> >  CTestfDoc* pDoc = GetDocument();
> >  ASSERT_VALID(pDoc);
> >  // TODO: add draw code for native data here
> >  CFont F1;
> >
> >
>
F1.CreateFont(600,300,-900,0,900,false,false,0,ANSI_CHARSET,OUT_DEFAULT_PREC
> > IS,
> >  CLIP_DEFAULT_PRECIS,DRAFT_QUALITY,DEFAULT_PITCH |
> >  FF_SWISS,"CG Times");
> >  CFont *F0=pDC->SelectObject(&F1);
> >  pDC->SetBkMode(TRANSPARENT);
> >  pDC->TextOut(2000,-5000,"Profiles"); // word1
> >  pDC->TextOut(2000,-7800,"   Profiles"); // word2
> >  pDC->SelectObject(F0);
> > }
> >
> >
> > void CTestfView::OnInitialUpdate()
> > {
> >  CScrollView::OnInitialUpdate();
> >
> >  CSize sizeTotal;
> >  // TODO: calculate the total size of this view
> >  sizeTotal.cx = 20000;sizeTotal.cy = 20000;
> >  SetScrollSizes(MM_HIMETRIC, sizeTotal);
> > }
> >
> >
> >
>
>


0
behzadvc1 (15)
12/11/2003 8:34:02 AM
Reply:

Similar Artilces:

Print area
I have a document where a print area has been set up and around the print area is a blue border and all of the cells have a colored background. How do I change the appearance of cells outside of the print area? Sounds like you're in Page Break Preview Click View, Normal -- HTH Roger Shaftesbury (UK) "Stephanie" <anonymous@discussions.microsoft.com> wrote in message news:E6BC3F7E-E0D5-408D-9D01-AE51471FDBA5@microsoft.com... > I have a document where a print area has been set up and around the print area is a blue border and all of the cells have a colored backgrou...

Getting appts to print on one page
I am using calendar assistant to print multiple overlaid calendars at once on letter size paper. All the appointments show up on the first page, except for one. This one pushes to a second monthly page duplicating the first. ie - I get two November 2009s - one with all appts except one and the other page with only the one rogue appointment -- Thanks, Alison ...

String manipulation
Hi all Please could someone give me a formula that strips out all non-numeric characters from a string variable contained in a cell, and returns a numerical value that contains the remaining characters preserving their order? eg: Cell A1 contains "a1b2c3" Function(A1) should return 123 Decimal point and sign characters are to be stripped out as if they were non-numeric, and the returned value will be a positive integer. Thanks. -- Return email address is not as DEEP as it appears Jack Sub RemoveAlphas() '' Remove alpha characters from a string. Dim intI As Integer Dim ...

too many different formatting cells
I can't open an excel document because whem I try to open it says that too many different formatting cells. How to resolve this and open this document? Maybe... XL: Error Message: Too Many Different Cell Formats http://support.microsoft.com/default.aspx?scid=213904 A few people have said that OpenOffice.Org has been able to open the file. Then they clean it up and save it there. Then excel can open that cleaned up version. http://www.openoffice.org, a 60-104 meg download or a CD jo wrote: > > I can't open an excel document because whem I try to open it says that too >...

Big difference in performance
I wrote a class on which I perform unit-testing before integration in the main development line, the unit-testing and main dev being two separate projects. I wrote a routine which constructs a data structure in the class, which uses CArrays, vectors, and the nth_element routine from STL, with the routine being recursive. Now, in the unit-test project, the routine takes ~3-4 seconds to execute. In the main development code, it takes ~70 seconds to execute. This is measured for the routine itself (no setup or cleanup), same data as input, same computer, and both projects compiled for debug. ...

Printing odd pages in booklet format
I used to be able to do this easily in PageMaker, but I can't figure it out for the life of me in Publisher... I am creating a booklet. Each page is 8.5 w and 5.5 tall (ie, half-letter, landscape orientation). I'd like to print this booklet two pages to one peice of paper, so I can cut in the middle and punch for a ring binder. I'd like the target paper to be letter (8.5 x 11). However, when I try to set it up as a book, I get a weird page that's 17x5.5. How can I change how the page is set up, so I can get both 8.5 x 5.5 pages to print in the correct orientation on the...

cash drawer not opening but reciept is printing
I have installed Microsoft RMS 2.0 on Windows Vista. I had issues installing my EPSON printer TM-T88IV. It would not work when i put it as "OPOS" device but it worked when i switched it to a "Windows" Device. Now the reciept prints but the problem is that the cash drawer wont open when the reciept is printed. The cash drawer is APG VB 320-BL1616. Any ideas whats wrong with it? thanks Bad cable perhaps? Can you switch cables with another register that IS working to see if it's the cable/pin configuration? Just a thought. "Akbar Mian" wrote: > I...

Difference between XML templates and Active Reports
Why does RMS use XML templates (for receipts and P.O.s) and for most other reports Active Reports? I realize that the XML receipts can not be changed or resorted on the preview screen, but why use not all active reports? Active reports are based on formating the results of a SQL Query - if you can work out the SQL to get the result set you want, you can create almost any report you want. The XML Templates are based on objects internal to RMS, like the current transaction for reciept printing, the active PO or Transfer request for PO prining, or a given customer for Statements. Y...

print area poser
need to know if this is possible want to automatically print data from sheet 1 via a print area in sheet2 once it has printed the data, i need it to clear this data and read from another row on sheet 1 all in all i need a single row print area in sheet 2 to read from about 50 different rows in sheet 1. dont think its possible myself but what do you reckon???? regards neil -- neilwebb ------------------------------------------------------------------------ neilwebb's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=24450 View this thread: http://www.excelfor...

How to display XML string returned by CRM Accountobject.retrive me
Hi All, Please let me know how i can display the query results fetched from crm database into Datagrid directly. Any help is appreciated. "Vijay Kr. Poriya" wrote: > Hi All, > > Please let me know how i can display the query results fetched from crm > database into Datagrid directly. > > Any help is appreciated. > > Vijay - I assume that you are referring to using the CRMAccount.Retrieve method documented at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/CrmSdk1_2/htm/v1d2crmaccountretrievemethod.asp This method will retrie...

Money 2000 Standard Check Printing
When I try to print a company check I get the error message "There are no checks to print in the "Absolute Audio Provident Bank" account. Money will only print checks for transactions that have "Print" in the number field." Everything I've tried to print has already had "Print" in the number field and it still won't print. Where should I go from here? Try repairing the file by closing Money, then go to Start, Run and type 'msmoney -s' without the quotes. Money should launch and repair. Then try to print checks again. "Just...

When printing, how do I keep a letter-sized document from expandi.
I have set up a landscape, letter-sized document in MS Pbulisher. But every time I try and print it, it expands the document to a legal-sized doc. Please help!!! Check your printer settings inside Publisher. -- JoAnn Paules MVP Microsoft [Publisher] "godovino" <godovino@discussions.microsoft.com> wrote in message news:6AEC49BF-CBCA-4F05-932C-034B008D6472@microsoft.com... >I have set up a landscape, letter-sized document in MS Pbulisher. But >every > time I try and print it, it expands the document to a legal-sized doc. > > Please help!!! Could ...

Publisher 2007 / Vista will not print
I get message "Publisher cannot complete the operation" when trying to print. Print preview shows image just fine. Am able to print other Office applications (and other non-Office apps) without difficulty. This is a recent problem, occurring only within the last month; prior to that, no difficulties. Is your printer driver current? Check with the manufacturer's web site. Try this, in the Printer Folder chose a different default printer. Open Publisher and your Publisher file. When viewing your document in print preview, minimize the screen, open the Printer folder, sel...

Printing too much!
Hello, I printed a spread sheet - it came out to 40 pages, but only 20 of the 40 pages had data. How do I set Excel to only print rows and columns with data - not the empty cells? I just hit the print button and it did it all. Thanks, Tmuld. Either set the print area or delete (not clear-DELETE) the un-needed rows and SAVE. Try again. -- Don Guillett SalesAid Software donaldb@281.com "Tavish Muldoon" <tmuldoon@spliced.com> wrote in message news:e2470f35.0411261334.13573d82@posting.google.com... > Hello, > > I printed a spread sheet - it came out to 40 pages, bu...

Custom Crystal report Print problem
Hi, I have some problem to print my custom crystal report. In first, I have an AD 2003 and my CRM server is on windows 2003 Server When i created my report, i have check the database location is SSO Thanks for your help Oops I'm tired, i need to go in holydays ;-) My problem When i have a custom report with parameter field, i am asked about parameters again!! if you have a solution thanks "Nicolas DUPONT" <ndupont@lmc.tm.fr> a �crit dans le message de news: 435893e9$0$7526$626a14ce@news.free.fr... > Hi, > > I have some problem to print my custom ...

Set print width to page width in VBA
IF I set the width, e.g. ActiveWorksheet.PageSetup..FitToPagesWide = 1 It automatically makes it 1 page tall, not good on long sheets, how do I set it to scale 1 page wide and however many pages tall? -- A)bort, R)etry, I)nfluence with large hammer. I recorded a macro when I did it manually. These are the lines that I'd keep: With ActiveSheet.PageSetup .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = False End With Trevor Best wrote: > > IF I set the width, e.g. > > ActiveWorksheet.PageSetup..FitToPagesWide = 1 > > It automat...

Print a window
I'm displaying a simple dialog box using VC++ 6.0. All I want to do is have a print button on the dialog window that simply prints the dialog window when clicked. I believe I'm close. I'm instantciating a device context object and setting the printer device context : pdc.Attach(dlg.GetPrinterDC()); I'm trying to use the CWnd::Print member function which is supposed to print the current window to the specified device context (in this case the printer). The best I can do is to print the non client area of the dialog window, but the dialog itself I cannot print. The ...

printing to a form
how do i print addresses from excel to an address form page? is i possible? the page came out of an address book and i have to do lik 200 of them. thank -- Message posted from http://www.ExcelForum.com ...

Odd Label Printing Issue
I'm using RMS v1.3.0206. I'm nearly done bringing up a new store. The Store Operations server and both POS terminals are doing great. Connections to HQ are all fully functional as far as I can tell. The problem I'm having is this: the office manager's PC won't print the price on the price tags! The other fields (ILC, BarCode, Description, SubDesc1/2/3, Last Rec'd, Price C) all print normally. The 'Price' field doesn't populate on the label--but only on this one PC! I use a custom label. The other PCs at the store can print the labels just fine...

Printing a two spreadsheets front and back
I have clicked select all sheets and selected two sided copy in print options. It gives me a message that 1 page has been printed, when I hit print, but when I go to the printer, there are two sheets of paper. Each spreadsheet on its own piece of paper. i have done this before, but when I do I print several copies, and months go by before I have to print the two sheets front and back again. Help. hi technically all excel does is send the data. seems to me the problem may be in your printer, not excel. make sure that you are printing to a duplex printer. regards FSt1 ...

Detect if vertical scrollbars visible in listbox ?
I have a need to know if there is data that can be scrolled to in a listbox. I'd rather not check the number of items listed since the height of the listbox may change. Is there a way to detect if the vertical scrollbars are visible or not? Thanks. "mscertified" <rupert@tigerlily.com> wrote in message news:42E5F377-C696-4FFF-9404-0D7E69D469D4@microsoft.com... >I have a need to know if there is data that can be scrolled to in a >listbox. > I'd rather not check the number of items listed since the height of the > listbox may change. > Is there a way...

Printing Portfolio view in Money 2006
Hi, I am viewing my portfolio...(from Home, Investing Home...Portfolio Manager) I try to print the portfolio...(Other tasks, More, Print, Portfolio Report). Nothing happens when I click on Print, Portfolio Report. I try using File, Print, also, nothing happens. I am using 2006, and have repaired my file, and rebooted my machine, but no luck. In microsoft.public.money, Curly_Money2006 wrote: >Hi, >I am viewing my portfolio...(from Home, Investing Home...Portfolio Manager) >I try to print the portfolio...(Other tasks, More, Print, Portfolio Report). >Nothing happens when I c...

Preview pane in 2003
With Office XP I was able to click on an email in my inbox and it would preview any pictures in the read pane without opening the attachment. I can not find how to do that in outlook 2003. Can someone help Outlook has never had the ability to do what you're asking. Outlook can only display images "inline" if the sender used HTML or Rich Text format for the message and embedded the image into the body. If the image was sent as an attachment, you will always receive it as an attachment...it's true for Outlook 2003 and was true for all previous versions. Perhaps the mes...

Publisher Problem: Printing a mail merge booklet on Kyocera Printe
We have run into an issue when printing a malmerge document from MS Publisher 2007 to a Kyocera printer. This is an 8 page newsletter which is supposed to be assembled as a booklet (folded and stapled) on a Kyocera KM-3232. The mailmerge address with a barcode is inserting correctly into publisher, with the data source an excel spreadsheet. But on the Kyocera the booklet is drawing the maximum pages (40) before folding and stapling. Kyocera says the problem is in Publisher. I can't find any information in publsiher to figure out how to fix it. The document prints correctly as one ...

Cant see highlighting unless I go into print preview
When i open an excel file I can not see the highlights on any documents unless you go into print preview. I have been looking for a way to show the highliting for a while now. I have compared the settings to another machine that shows the highlights normally and found no difference. I have also reinstalled it and the problem reoccures. The same document can be opened by others and they see the highlights, and it doesnt matter what document it is. This occurs on all documents. trapped Assuming "highlights" means colored cells.......... If this is a problem with all Excel file...