[Glass] PDFtalk for GemStone questions

Jupiter Jones via Glass glass at lists.gemtalksystems.com
Thu Oct 26 17:01:48 PDT 2017


Hiya,

I’m checking out Christians’ PDFtalk library in GemStone and had a couple of queries.

After loading the PDFtalk.gs and PDFtalkTesting.gs I wanted to check out the demos and have a play with making my own PDF.

In tODE: 
browse symbolDict PDFtalk
Definitions
--------------------
AttributeType{55005953}
 ArrayType{54966017}
 DictionaryType{55295745}
  NameTreeType{54969089}
 DirectType{55471873}
 IndirectType{55468801}
 ObjectType{54939393}
 UndefinedType{54924545}
… etc

browse symbolDict PDFtalkLibrary
Definitions
--------------------
ByteReadStream{55300097}
ByteWriteStream{55566081}
ColorValue{55527169}
CoverageValue{37341953}
Emitter{55524097}
 SourceEmitter{55521025}
  Blockemitter{55496449}
  Lineemitter{55490305}
 TextEmitter{55511809}
  TextBlockemitter{55508737}
  TextLineemitter{55484161}
OrderedDictionary{55493377}
PDF{55558913}
Timestamp{55530241}
… etc

I haven’t seen the oops in {} in tODE before. Do they indicate something?

The first demo (for example) in the PDF class is a HelloWorld:
demo01_HelloWorld
  "PDF demo01_HelloWorld"

  | page |
  page := PDF Page
    newInBounds: (0 @ 0 corner: 70 @ 20)
    colorspace: (PDF classAt: #'DeviceCMYK') new
    render: [ :renderer | 
      renderer fillColor: CmykColor black.
      renderer
        textObjectDo: [ 
          renderer setFont: #'Helvetica' size: 10.
          renderer add: (NextLineRelative operands: #(10 5)).
          renderer showString: 'Hello World' ] ].
  page saveAndShowAs: ‘demo01_HelloWorld.pdf'

I selected the comment text in tOODE and inspected it (CMD-I) and got the error: CompileError occurred (error 1001), undefined symbol  PDF

If PDFtalkLibrary is in my symbol list, shouldn’t the compiler ‘see’ the PDF class?

I tried the same thing in Topaz and it worked as expected - saved the PDF in my home directory,

I’ve updated to the latest tODE and am testing in GS3.3.6.

In the demo method above, CmykColor (defined in PDFtalkLibrary in my symbol'ist) and NextLineRelative (defined in PDFtalk not in my symbol list, but defined in PDFtalkLibrary) also appear undefined in tODE. In Topaz, CmykColor is visible, but not NextLineRelative…

topaz 1> printit
NextLineRelative
%
GemStone Smalltalk Compiler Errors:
   NextLineRelative
 * ^1                                                                 *******

1: [1031] undefined symbol
topaz 1> printit
CmykColor
%
a metaCmykColor
  superClass          a metaValue
  format              0
  instVarsInfo        1125899906846726
  instVarNames        a Array
  constraints         a Array
  classVars           nil
  methDicts           a GsMethodDictionary
  poolDictionaries nil
  categorys           a GsMethodDictionary
  primaryCopy         nil
  name                CmykColor
  classHistory        a ClassHistory
  transientMethDicts a Array
  destClass           nil
  timeStamp           a DateTime
  userId              DataCurator
  extraDict           a SymbolDictionary
  classCategory       PDFtalk Colour
  subclasses          nil
topaz 1> 

That makes sense to me as PDFtalk is not in my symbol list.

So… :)

How do I go about running these methods in tODE?
How is Topaz running the #demo01_HelloWorld method, but the compiler not see NextLineRelative? 

As Christian describes in : https://wiki.pdftalk.de/doku.php?id=pdftalk4gemstone <https://wiki.pdftalk.de/doku.php?id=pdftalk4gemstone>
shouldn't the code be PDFtalk at: #NextLineRelative. The demo method executes fine without that in Topaz, which breaks my understanding of GS symbol lists :)

topaz 1> printit
PDFtalk at: #NextLineRelative
%
a metaNextLineRelative
  superClass          a metaTextPositioningOperation
  format              0
  instVarsInfo        1125899906846721
  instVarNames        a Array
  constraints         a Array
  classVars           nil
  methDicts           a GsMethodDictionary
  poolDictionaries nil
  categorys           a GsMethodDictionary
  primaryCopy         nil
  name                NextLineRelative
  classHistory        a ClassHistory
  transientMethDicts a Array
  destClass           nil
  timeStamp           a DateTime
  userId              DataCurator
  extraDict           a SymbolDictionary
  classCategory       PDFtalk Graphics Operations
  subclasses          nil

If there’s something really obvious I’m missing, point me at the docs and I’ll being myself up to date. I’ve read the GS docs about symbol lists again, but am still not sure what’s going on here.

Cheers,

J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20171027/e00e3f3b/attachment-0001.html>


More information about the Glass mailing list