[Pharo-users] RT export to PDF

Stephan Eggermont stephan at stack.nl
Sun May 1 06:24:49 EDT 2016

On 01/05/16 04:00, Arturo Zambrano wrote:
> Hi,
>   I'm using RT on top of pharo5.
>   As I need to export to pdf, I also installed
> RTPDFExporter
> and
> Artefact
> development versions
> Exporting to pdf fails with MNU RTPDFVisitor>>visitMapShape:
> any hint regarding this?

The PDF exporter has its last updates in november, so might be slightly 
out of date. When comparing RTSVGVisitor2 to RTPDFVisitor, I notice
some missing visitors.

AFAIK, Artefact has limited bitmap support at the moment,
and uses the JPEGReadWriter instead of embedding directly.


You need to add something like

RTPDFVisitor>>visitBitMapShape: aBitmapShape	
	| s |
	s := WriteStream on: ByteArray new.
	TRPlatform current pngReadWriterClass putForm: (aBitmapShape form) 
onStream: s.
	page add:
				from: aBitmapShape encompassingRectangle topLeft x mm @
					aBitmapShape encompassingRectangle topLeft y mm
				dimension: aBitmapShape width mm @ aBitmapShape height mm
				fromStream: s contents readStream)


More information about the Pharo-users mailing list