RT export to PDF

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RT export to PDF

Arturo Zambrano
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?

cheers,
arturo
Reply | Threaded
Open this post in threaded view
|

Re: RT export to PDF

Stephan Eggermont-3
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.

http://forum.world.st/PNG-in-Artefact-td4798885.html

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:
                                (PDFPngElement
                                from: aBitmapShape encompassingRectangle topLeft x mm @
                                        aBitmapShape encompassingRectangle topLeft y mm
                                dimension: aBitmapShape width mm @ aBitmapShape height mm
                                fromStream: s contents readStream)

Stephan


Reply | Threaded
Open this post in threaded view
|

Re: RT export to PDF

Arturo Zambrano
Thanks Stephan!

On Sun, May 1, 2016 at 7:24 AM, Stephan Eggermont <[hidden email]> wrote:
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.

http://forum.world.st/PNG-in-Artefact-td4798885.html

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:
                                (PDFPngElement
                                from: aBitmapShape encompassingRectangle topLeft x mm @
                                        aBitmapShape encompassingRectangle topLeft y mm
                                dimension: aBitmapShape width mm @ aBitmapShape height mm
                                fromStream: s contents readStream)

Stephan