pdf.OpenDocument and virtual files

Discuss PDF file handling with the Polybios plugin here
Post Reply
p-OS
Posts: 112
Joined: Mon Nov 01, 2010 11:56 pm

pdf.OpenDocument and virtual files

Post by p-OS » Fri Sep 20, 2019 2:12 am

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"

User avatar
airsoftsoftwair
Posts: 3206
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: pdf.OpenDocument and virtual files

Post by airsoftsoftwair » Sat Sep 21, 2019 2:56 pm

Looks like doc:SaveToFile() doesn't support virtual files yet. I'll fix this.

Post Reply