Skip to content

Commit

Permalink
Fixe Artefact for Pharo 7 (I hope)
Browse files Browse the repository at this point in the history
Related to #2
  • Loading branch information
jecisc committed Oct 12, 2018
1 parent 7cf7aa9 commit f6d4665
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Artefact-Core/PDFStreamPrinter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ PDFStreamPrinter >> printModel: aPDFCompleteModel compression: mustBeCompressed
characterStream nextPutAll: '%PDF-1.4'; lf.
aPDFCompleteModel acceptVisitor: self.
characterStream nextPutAll: '%%EOF'; lf.

aStream flush
]

{ #category : #print }
Expand Down Expand Up @@ -279,13 +281,15 @@ PDFStreamPrinter >> printPDFDataStreamRefSize: aPDFDataStreamRefSize [
{ #category : #visit }
PDFStreamPrinter >> printPDFDataXObjectStream: aPDFDataXObjectStream [
| endPosition startPosition |
stream nextPutAll: 'stream'; lf.
characterStream
nextPutAll: 'stream';
lf.
startPosition := stream position.
stream nextPutAll: (aPDFDataXObjectStream stream reset contents).
stream nextPutAll: aPDFDataXObjectStream stream reset contents.
endPosition := stream position.
stream lf.
characterStream lf.
self size at: aPDFDataXObjectStream put: endPosition - startPosition.
stream nextPutAll: 'endstream'.
characterStream nextPutAll: 'endstream'
]

{ #category : #util }
Expand Down
1 change: 1 addition & 0 deletions src/Artefact-Examples/PDFDemos.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ PDFDemos class >> streamNamed: aName [
| file |
file := (self demoPath , aName) asFileReference.
file parent ensureCreateDirectory.
file ensureDelete.
self flag: #todo. "The next expression is a hack to correct a Pharo 6/7 compatibility.
We need a binary write stream to print on but the way to get one changed between Pharo 6 and 7. To improve the code we could add a Pharo^ compatibility package that would add #binaryWriteStream to Pharo 6, but I have not time for now, I just want to make demos work.
"
Expand Down

0 comments on commit f6d4665

Please sign in to comment.