Xojo Conferences
XDCMay2019MiamiUSA

[MBS] Problem with Carbon Print Manager (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] 255 char limit on debugmessage
Next thread: [MBS] JPEG comparison / delta


Re: [MBS] MIDI Destinations and External Devices   -   Ron Benditt
  [MBS] Problem with Carbon Print Manager   -   Guillermo
   Re: [MBS] Problem with Carbon Print Manager   -   Christian Schmitz

[MBS] Problem with Carbon Print Manager
Date: 30.01.04 18:41 (Fri, 30 Jan 2004 18:41:36 +0100)
From: Guillermo
Hello

I'm trying to use the Carbon Print Manager routines, but I have a
problem when printing, the method PageContext in CPMPrintSessionMBS
always return nil at the second page !!! works fine at the first page.

For example this is a fragment of the example "Carbon print hello.rb"
that comes with the plugin, in the button "Print PDF to PDF", the
original code print only the first page of the PDF:

.....
ps.BeginPageNoDialog pf,pr
g=ps.PageContext

g.DrawCGPDFDocument pdf,cr,1
g.SelectFont "Helvetica",18,1
g.SetRGBFillColor 0,0,0,1
g.ShowTextAtPoint "The first page of the pdf file.",20,20
g.FillPath
g=nil

ps.EndPageNoDialog
ps.EndDocumentNoDialog
.....

I modified to:
....
dim i as integer
....

for ito pdf.pageCount

ps.BeginPageNoDialog pf,pr
g=ps.PageContext

g.DrawCGPDFDocument pdf,cr,i
g.SelectFont "Helvetica",18,1
g.SetRGBFillColor 0,0,0,1
g.ShowTextAtPoint "The page "+str(i)+" of the pdf file.",20,20
g.FillPath
g=nil

ps.EndPageNoDialog
next
ps.EndDocumentNoDialog

The program crash with a nil object exception at "g.DrawCGPDFDocument
pdf,cr,i", the debugger shows that g is nil and i (second page).

Guillermo

Re: [MBS] Problem with Carbon Print Manager
Date: 30.01.04 20:26 (Fri, 30 Jan 2004 20:26:37 +0100)
From: Christian Schmitz
Guillermo <<email address removed>> wrote:

> Hello
>
> I'm trying to use the Carbon Print Manager routines, but I have a
> problem when printing, the method PageContext in CPMPrintSessionMBS
> always return nil at the second page !!! works fine at the first page.
>

It's reproduceable and fixed in 4.0dr7. (Email is you need it today)

Mfg
Christian