Crash when Loading a PDF File as an Asset (linked to an APK)

Discuss PDF file handling with the Polybios plugin here
Post Reply
PEB
Posts: 567
Joined: Sun Feb 21, 2010 1:28 am

Crash when Loading a PDF File as an Asset (linked to an APK)

Post by PEB »

My Android app (made with the Hollywood APK Compiler) crashes when I use pdf.OpenDocument() to load a PDF linked as an asset using GetAsset().
PEB
Posts: 567
Joined: Sun Feb 21, 2010 1:28 am

Re: Crash when Loading a PDF File as an Asset (linked to an APK)

Post by PEB »

A related question (possibly a work-around):
Is there a way to link a PDF file to an executable with a preprocessor command, such as @FILE?
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Crash when Loading a PDF File as an Asset (linked to an APK)

Post by airsoftsoftwair »

Thanks for the report, I'll check what's wrong there.

As for a workaround, you could try something like this:

Code: Select all

@FILE 1, "test.pdf"
data$ = ReadBytes(1)
vfile$ = DefineVirtualFileFromString(data$, "test.pdf")
pdf.OpenDocument(1, vfile$)
data$ = Nil
vfile$ = Nil
I haven't tested it but it should work... if it doesn't file another bug report :)
PEB
Posts: 567
Joined: Sun Feb 21, 2010 1:28 am

Re: Crash when Loading a PDF File as an Asset (linked to an APK)

Post by PEB »

Thanks! (That work-around works perfectly.)
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Crash when Loading a PDF File as an Asset (linked to an APK)

Post by airsoftsoftwair »

Code: Select all

- Fix [Android]: Querying file attributes on an asset or using DOSBase.FStat() on it led to a crash
Post Reply