Post Reply 
Files on HP Prime Question
05-21-2015, 06:38 PM
Post: #21
RE: Files on HP Prime Question
(05-20-2015 10:10 PM)critor Wrote:  
We could convert a PDF into a collection of several PNG images, with one image per page.
But …
- to be able to get a part of a file data, we have to use AFilesB() and not AFiles()
- to be able to display the PNG data, we have to use AFiles() and not AFilesB()

Any idea of a workaround ? Any other ideas ?

How about generating png files on demand from the archive file? Here's what I tried…

1. Make a couple png files, from screen captures. (I entered a bunch of trivial calculations between captures to make it obvious [to me] which png was which.)
Code:

AFiles("img1.png"):=G0
AFiles("img2.png"):=G0

2. Store the sizes of the two files in J and T.
Code:

J:=AFilesB("img1.png")
T:=AFilesB("img2.png")

3. Combine the two png files into a single combo png file.
Code:

AFilesB("big.combopng",0):=AFilesB("img1.png",0,J)
AFilesB("big.combopng",J):=AFilesB("img2.png",0,T)

4. Pull out the two files.
Code:

AFilesB("pulled1.png",0):=AFilesB("big.combopng",0,J)
AFilesB("pulled2.png",0):=AFilesB("big.combopng",J,T)

5. Try displaying the two files.
Code:

G0:=AFiles("pulled1.png");WAIT(0)
G0:=AFiles("pulled2.png");WAIT(0)

The above worked for my screen captures. For larger png files it may well be prudent to read / write in fixed size blocks (rather than the whole png at once).

The above is just a quick test. A viewer would likely simply do #4 / #5 on demand (produce, e.g., "todisplay.png" from "big.combopng" with offsets & size depending on the png to display).

For larger text-heavy documents (or, more generally, documents where cross-page compression can pay off) a more sophisticated format should allow better use of the available memory.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Files on HP Prime Question - mandresve - 05-14-2015, 01:48 AM
RE: Files on HP Prime Question - mandresve - 05-15-2015, 01:08 AM
RE: Files on HP Prime Question - mandresve - 05-15-2015, 04:30 AM
RE: Files on HP Prime Question - debrouxl - 05-15-2015, 07:57 PM
RE: Files on HP Prime Question - mandresve - 05-16-2015, 12:56 AM
RE: Files on HP Prime Question - debrouxl - 05-16-2015, 07:18 AM
RE: Files on HP Prime Question - mandresve - 05-16-2015, 11:39 PM
RE: Files on HP Prime Question - mandresve - 05-18-2015, 05:56 AM
RE: Files on HP Prime Question - critor - 05-20-2015, 10:10 PM
RE: Files on HP Prime Question - critor - 05-21-2015, 03:43 PM
RE: Files on HP Prime Question - critor - 05-24-2015, 09:49 AM
RE: Files on HP Prime Question - jte - 05-21-2015 06:38 PM
RE: Files on HP Prime Question - debrouxl - 05-21-2015, 06:02 AM
RE: Files on HP Prime Question - Adriweb - 05-21-2015, 03:48 PM
RE: Files on HP Prime Question - critor - 05-21-2015, 04:56 PM
RE: Files on HP Prime Question - critor - 05-21-2015, 06:45 PM



User(s) browsing this thread: 1 Guest(s)