Page 1 of 1

pdf.OpenDocument and virtual files

Posted: Fri Sep 20, 2019 2:12 am
by p-OS
In my program I want to create a pdf using Polybios and read it again for displaying.

In my first attempt I saved the pdf document to a temporary file and then opened the document again.
Worked .

But now I tried to use a virtual file instead:



@REQUIRE "polybios"

doc=pdf.CreateDocument()

; ...
; now generating pages and content
; ...

virt=DefineVirtualFileFromString("","dummy.pdf",True)
doc:SaveToFile(virt)
;...
doc2=pdf.OpenDocument(Nil,virt)
mybrush=pdf.GetBrush(doc2,1,Nil)
DisplayBrush(mybrush,#CENTER,#CENTER)


results in "Error opening PDF document"

Re: pdf.OpenDocument and virtual files

Posted: Sat Sep 21, 2019 2:56 pm
by airsoftsoftwair
Looks like doc:SaveToFile() doesn't support virtual files yet. I'll fix this.