pdf.OpenDocument and virtual files

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

pdf.OpenDocument and virtual files

Post 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"

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

Re: pdf.OpenDocument and virtual files

Post by airsoftsoftwair »

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

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

Re: pdf.OpenDocument and virtual files

Post by airsoftsoftwair »

Code: Select all

- Fix: doc:SaveToFile() wasn't compatible with virtual files 

p-OS
Posts: 124
Joined: Mon Nov 01, 2010 11:56 pm

Re: pdf.OpenDocument and virtual files

Post by p-OS »

Thanks !

Post Reply