realbasic-nug
[Top] [All Lists]

Re: Printing at 72dpi, but no Jaggies!

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Printing at 72dpi, but no Jaggies!
From: Fargo Holiday <fargo at rpgportland dot com>
Date: Wed, 30 May 2007 11:33:21 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <465DC1E1 dot 9040900 at kinnor dot com>
If I'm not mistaken, which I could be, the printer driver is responsible 
for up or downmixing objects to fit the requested resolution. Probably 
by using vectors instead of straight rasterizing.

tbuchler wrote:
> By default, OpenPrinterDialog is returning a graphics object with a 
> resolution of 72dpi, so an average U.S. letter is 612 pixels wide. My 
> printer's native resolution is 600 dpi, and the Printer dialog settings 
> is showing the printer is currently set to 600 dpi.
>
> When I draw on the page at 72dpi, specifying graphic objects' locations 
> based on 72dpi, the objects are being printed where I expect them to be. 
> Fonts and lines are being drawn without jaggies, as though they were 
> being drawn at 600 dpi.
>
> How is RB achieving this apparent miracle? Certainly not actually 
> drawing on a 72dpi graphics object and expanding it to the printer's 
> native rez, which would cause jaggies.
>
> -Tom
>
> _______________________________________________
>
>
>   
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


From  Wed 30 May 2007 14:38:57 -0400
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
        id C09DD299DBA8; Wed, 30 May 2007 11:39:07 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on 
        www.realsoftware.com
X-Spam-Level: 
X-Spam-Status: No, score=-0.7 required=4.5 tests=AWL,BAYES_00,MISSING_SUBJECT,
        NO_REAL_NAME autolearn=no version=3.1.1
Received: from lists.realsoftware.com (m.realsoftware.com [66.116.103.65])
        by xmail.realsoftware.com (Postfix) with ESMTP id B5B84299DB93;
        Wed, 30 May 2007 11:39:06 -0700 (PDT)
Received: from real-software-mini.local (localhost [127.0.0.1])
        by lists.realsoftware.com (Postfix) with ESMTP id 9CD3D331107;
        Wed, 30 May 2007 13:38:59 -0500 (CDT)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from mout.perfora.net (mout.perfora.net [74.208.4.195])
        by lists.realsoftware.com (Postfix) with ESMTP id 826943310FC
        for <realbasic-nug at lists dot realsoftware dot com>;
        Wed, 30 May 2007 13:38:55 -0500 (CDT)
Received: from [172.19.56.141] (helo=pustefix137.perfora.net)
        by mrelay.perfora.net (node=mrus1) with ESMTP (Nemesis),
        id 0MKpCa-1HtT4T440X-0001aA; Wed, 30 May 2007 14:38:58 -0400
Message-Id: <30192617 dot 58331180550337965 dot JavaMail dot servlet at perfora>
From: rblists at oatmealandcoffee dot com
To: <realbasic-nug at lists dot realsoftware dot com>
Subject: 
MIME-Version: 1.0
X-Priority: 3
X-Binford: 6100 (more power)
X-Mailer: Webmail
X-Originating-From: 32022859
X-Routing: US
X-Message-Id: <32022859$1180550337902172 dot 19 dot 56 dot 14114205934 at 
pustefix137 dot perfora dot net-1963677313>
X-Received: from pustefix137.perfora.net by 64.215.189.102 with HTTP id
        32022859 for [realbasic-nug at lists dot realsoftware dot com];
        Wed, 30 May 2007 14:38:57 EDT
Date: Wed, 30 May 2007 14:38:57 -0400
X-Provags-ID: V01U2FsdGVkX1+VYMWldsYIYRk0ywNI97mvkCbL1fsoKz071Kw
        ci8RLhp8eElxMkubyazaB+wkmqdBD2qY07tKa93t+bkXGyfAOC 3c14FQIKJU=
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com

Howdy--

I swear I'm the only person who posts about this stuff, because searches reveal 
squat. Anyway...

I'm having a massive problem catching errors while getting font information 
from Excel. The following parses text in an Excel cell to get various styling 
information for later use. The occasional problem comes the moment I try to get 
the name of the font used for a particular character. Sometimes there's an 
error, but none of the error catching methods seem to work. 

I think part of the problem might be that I get two different errors, 
NilObjectException or OLEException, when I'm in Debug mode and in a compiled 
app, respectively. However, neither the Try nor the Exception block can catchi 
either of these errors. The thing that really has my head scratching is that 
when I look at the value for the font name variable I've set, it has the 
correct value but still returns the error.

In the end, I don't mind the errors because the process allows for errors to 
get fixed later. I just need to be able to allow the app to continue all of 
it's work to catch 80% or so of the formatting information, and would prefer to 
record somewhere the remaining the app couldn't catch. Very similar code in a 
Macro works fine, but I really can't do that due to various restrictions in the 
overall production process.

Any ideas? Here's the code...

Sub Parse()

  //This code sits in a thread, called by "Run".
  dim ExcelApp as ExcelApplication
  dim wb as ExcelWorkbook
  dim ws as ExcelWorksheet
  dim wc as ExcelRange
  dim theChr as ExcelCharacters
  dim theFont as ExcelFont
  dim x as integer
  dim theFontName as string
  dim theFontNameStyle as string
  
  ExcelApp = new ExcelApplication
  wb = ExcelApp.ActiveWorkbook
  ws = wb.ActiveSheet
  wc = ws.Range(TheRange) //string property of the thread
  
  ChrCount = Len(wc.Value)
  
  for x = 1 to ChrCount
    theChr = wc.Characters(x, 1)
    //get the font name
    try
      theFont = theChr.Font
      theFontName = theFont.Name //NilObjectException here but the debugger 
shows the correct value.
    Catch err 'as NilObjectException //doesn't catch anything.
      If err IsA NilObjectException then //returned error in Debug mode
        LogModule.WriteLog("ParseErrorLog", TheRange + ":" + str(x) + " = 
theFontName = Left(theChr.Font.Name, 3)")
      elseif err IsA OLEException then //returned error when compiled
        LogModule.WriteLog("ParseErrorLog", TheRange + ":" + str(x) + " = 
theFontName = Left(theChr.Font.Name, 3)")
      End If
    end try
    
  Next
  
  //I'm done, so let my parent know and stop
  me.ParentCaptionObj.ParsingComplete = true
  me.Kill
  
Exception err 'as NilObjectException //doesn't catch anything.
  If err IsA NilObjectException then
    LogModule.WriteLog("ParseErrorLog", TheRange + ":" + str(x) + " = " + 
theChr.Value + ": " + ws.Range(TheRange).Text)
  elseif err IsA OLEException then
    LogModule.WriteLog("ParseErrorLog", TheRange + ":" + str(x) + " = " + 
theChr.Value + ": " + ws.Range(TheRange).Text)
  End If
End Sub

TIA!
--
Philip Regan
http://www.oatmealandcoffee.com
RB2k7r2, Office 2k4, MAc OS 10.4.9
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>