Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: mdr1 on January 03, 2013, 04:34:02 pm

Title: A viewer of PDF
Post by: mdr1 on January 03, 2013, 04:34:02 pm
Hello everybody !

I think that it would be great to adapt a lector of PDF for TI-Nspire from ozbookr (http://code.google.com/p/ozbookr/). Its size is maximum 1.2 megas et works perfectly on PSP with 222MHz.
But there's some problems :
1) It is coded in C++ and it seems that some C++ codes don't work on TI-Nspire (very weird because we should do every thing we want).
2) To compile the library freetype needed, the command "make" doen"t work with ndlesseditor.

For this project's developpement, I suggest to the most experiment of you to do it (I won't have the time). For example, extended, Levak, tangrs.

Imagine a lector of PDF on TI-Nspire :

(http://tiplanet.org/forum/download/file.php?mode=view&id=441&sid=8979b39cf5a5e76fb55e82d05c6fb1f8)

Message en français :
Spoiler For Spoiler:
Bonjour à tous !

Je pense qu'il serait bien qu'il soit effectué un lecteur de PDF pour TI-Nspire, adapté de ozbookr. Ce programme fait maximum 1.2 Mégas et tourne parfaitement à 222MHz sur PSP.
Mais voici les problèmes rencontrés :
1) C'est en C++ et il parait que tout ce qu'il y a en C++ ne marche pas pour TI-Nspire (ce que je trouve vraiment très bizarre vu que théoriquement, on devrait tout pouvoir faire.
2) Pour compiler la librairie freetype nécessaire, bizarrement, la commande "make" ne marche pas avec ndlesseditor.

Pour le développement de ce projet, je propose aux plus expérimentés d'entre vous de s'y atteler (moi, je n'aurai pas le temps). Par exemple, extended, Levak, tangrs.

Imaginez un lecteur de PDF pour TI-Nspire :
Title: Re: A viewer of PDF
Post by: ExtendeD on January 03, 2013, 04:59:17 pm
'making' from the Ndless Editor is possible, just open a console with Tools > Ndless SDK console.
Title: Re: A viewer of PDF
Post by: Vogtinator on January 03, 2013, 05:07:22 pm
C++? I'd wait untill ELF or bflt are integrated into ndless.
That would make it a whole lot easier.
Title: Re: A viewer of PDF
Post by: ExtendeD on January 03, 2013, 05:14:19 pm
tangrs's bFLT support has actually already been integrated into Ndless's SVN trunk, but seems to conflict when linking with nSDL.
As I don't know much about the bFLT format and the linker's magic I'm unfortunately stuck, any help is welcome.
Title: Re: A viewer of PDF
Post by: ElementCoder on January 03, 2013, 05:14:38 pm
ELF is available, iirc tangrs made it, but I don't know how its current state of development is.
Title: Re: A viewer of PDF
Post by: Vogtinator on January 03, 2013, 05:32:23 pm
I don't even know what bflt is..
I googled it, it's not even directly supported by gcc, is it?
What are the advantages over ELF, which would be easier to work with?

BTW: I can't find the svn repo for ndless..
Title: Re: A viewer of PDF
Post by: lkj on January 03, 2013, 06:43:24 pm
The repo is at https://www.unsads.com/scm/svn/nsptools/Ndless/trunk (https://www.unsads.com/scm/svn/nsptools/Ndless/trunk)

bflt is much easier to write a loader for than ELF.
Title: Re: A viewer of PDF
Post by: Vogtinator on January 03, 2013, 07:05:35 pm
"Authorization Required"

But tangrs already wrote an ELF loader.
Title: Re: A viewer of PDF
Post by: lkj on January 03, 2013, 07:46:50 pm
I think there was also some issue with much bigger executables or something. And I'm not sure the loader was finished and bug-free.

Edit: It's not finished.
Also it's two times guest.
Title: Re: A viewer of PDF
Post by: Lionel Debroux on January 04, 2013, 02:15:28 am
ELF is much more complex than bFLT is. An ELF loader is a complicated piece of code (well, that's not so much of a problem, as long as it works), whose binary has some weight (more of a problem on such low-powered embedded platforms), and ELF binaries can be surprisingly large, according to tangrs' own tests.
bFLT is a simple format, which supports .text, .data, .bss, and relocations involving those; it can be easily produced from ELF input. It's more suitable than ELF to such low-powered embedded platforms as ours.
Title: Re: A viewer of PDF
Post by: Le solutionneur on January 05, 2013, 12:37:57 pm
Why would we need to statically link our modules?
Title: Re: A viewer of PDF
Post by: Lionel Debroux on January 05, 2013, 01:07:24 pm
Not sure what you mean, as bFLT supports dynamic libraries ?
Title: Re: A viewer of PDF
Post by: Levak on April 14, 2013, 07:11:50 pm
"Authorization Required"
guest/guest
Title: Re: A viewer of PDF
Post by: Dapianokid on April 15, 2013, 04:26:34 pm
I am trying to get my permit and using nTxt is dangerous to read files, and my PDF to text converter of choice isn't perfect. So, this project would be amazing
Title: Re: A viewer of PDF
Post by: floris497 on April 15, 2013, 04:32:39 pm
is this something i or someone else can port? http://code.google.com/p/nupdf/
Title: Re: A viewer of PDF
Post by: _Nicco_ on April 15, 2013, 08:57:54 pm
PDF reader for the Nspire?  That sounds useful.

One question I have is how would you format the pages to fit well on the screens of the Nspire?  You would need to do a lot of scrolling and side scrolling to be able to read which kind of sucks.

<b>EDIT:</b> I just realized that this thread was pretty old.  Is anyone working on this still?
Title: Re: A viewer of PDF
Post by: Lionel Debroux on April 16, 2013, 01:50:30 am
Quote
is this something i or someone else can port? http://code.google.com/p/nupdf/
The Dingoo is a much more powerful platform than the Nspire is, and it has hardware acceleration for video, unlike the Nspire series. Porting that program might work (especially as it uses SDL, so a port to nSDL might be relatively straightforward), but I wouldn't hold my breath.

Quote
EDIT: I just realized that this thread was pretty old.  Is anyone working on this still?
It doesn't seem so.
Title: Re: A viewer of PDF
Post by: Dapianokid on April 16, 2013, 12:48:14 pm
Porting Genesis Plus is a very meitculous task, but my father has some very beneficial experience with it. I'm porting a bible reader to the Nspires as well, so this could be in the future for me, when I'm less busy
Title: Re: A viewer of PDF
Post by: Le solutionneur on October 23, 2013, 07:03:42 am
It would require to port libmupdf and libfont first.
The first one source code is available in the SumatraPDF repository :)
Title: Re: A viewer of PDF
Post by: Legimet on October 26, 2013, 10:34:29 pm
I have already ported libmupdf, making a pdf viewer now.
Title: Re: A viewer of PDF
Post by: Jim Bauwens on October 27, 2013, 06:50:08 am
I have already ported libmupdf, making a pdf viewer now.

That's great news :)
Title: Re: A viewer of PDF
Post by: critor on October 27, 2013, 08:53:57 am
Great! :D
Title: Re: A viewer of PDF
Post by: Adriweb on October 27, 2013, 11:00:32 am
Indeed, nice start, I hope the lib will be powerful enough to open what people mostly have as PDFs file (the format is really not trivial and complex.... and some documents don't even display properly on computer readers !)
Title: Re: A viewer of PDF
Post by: mdr1 on October 31, 2013, 12:00:58 pm
I have already ported libmupdf, making a pdf viewer now.
Really? We're finally about to have a better text viewer than the old m68k's ones then?
Thanks a lot!
Title: Re: A viewer of PDF
Post by: Le solutionneur on October 31, 2013, 12:14:58 pm
@Adriweb: libmupdf is done and used by SumatraPDF, it can open a great number of formats in a quick manner and displays everything like it should :D
Title: Re: A viewer of PDF
Post by: Legimet on November 11, 2013, 09:48:50 pm
Yes, MuPDF is good enough for most PDF's, as long as you don't have things like forms (you need V8 for that) or videos, but I don't think anyone would view such PDF documents on a calculator. :P It also supports xps and cbz. While I'm making the viewer (I haven't had much time these days), here's a screenshot of a program that renders the first page of a pdf to a png file. Later, I open it with mViewer.

(http://img.ourl.ca/MuPDFRenderToPNG.gif)

The lag at the beginning is ndless loading it (it's a big file). Apparently, ndless tries to load it as a legacy executable before trying bFLT. It can easily be modified to check the header of the file before attempting to load it. I can also make some big fonts optional to reduce the size.

By the way, MuPDF depends on some other libraries which I ported (zlib, jbig2dec, openjpeg, libjpeg, freetype) which were very easy to port.
Title: Re: A viewer of PDF
Post by: critor on November 12, 2013, 06:14:29 am
Great! :D

How are you going to handle several pages?
Title: Re: A viewer of PDF
Post by: Legimet on November 12, 2013, 10:02:42 am
That's pretty easy to do. This is just a program showing that the library actually works.
Title: Re: A viewer of PDF
Post by: Le solutionneur on November 13, 2013, 05:51:25 pm
Will you allow to search in a document? Will it be possible to fit the page to the screen?
Nice work! :D
Title: Re: A viewer of PDF
Post by: DJ Omnimaga on November 13, 2013, 05:58:49 pm
When released this will definitively be great. I know that some people asked for the ability to read Doc or PDF files (the former can be converted to PDF) so yeah. This will most likely make front page here too assuming I find some time to post a news. :)
Title: Re: A viewer of PDF
Post by: mdr1 on November 14, 2013, 08:17:10 am
Thanks a lot for your work Legimet!  :D

The lag at the beginning is ndless loading it (it's a big file). Apparently, ndless tries to load it as a legacy executable before trying bFLT. It can easily be modified to check the header of the file before attempting to load it. I can also make some big fonts optional to reduce the size.
It could be a good feature for a new version of ndless, indeed. It arrives each time an associated file is opened directly from the menu "Mes classeurs".

Quote
By the way, MuPDF depends on some other libraries which I ported (zlib, jbig2dec, openjpeg, libjpeg, freetype) which were very easy to port.
Somes librairies like zlib are used in several ndless programs, and then included in the file each time. It could be good to add the possibility to have files like DLL.


I hope the viewer won't need zooming and horizontal scrolling as needed with mViewer... I don't know if an adaptation to the screen size is possible with this library.
PS: Will links to other pages or documents be available?
Title: Re: A viewer of PDF
Post by: Lionel Debroux on November 14, 2013, 08:28:34 am
Not that zlib is huge, but FWIW, the Nspire OS itself contains zlib, and a number of zlib functions have been exported by Ndless as syscalls for two years and a half (OSLauncher was the first program to depend on these syscalls) :)
Unless some of the zlib functions MuPDF needs are not available at all in the version embedded into the Nspire's OS, you could leverage the OS's copy of zlib (adding syscalls to the IDC files and Ndless lists if need be).
Title: Re: A viewer of PDF
Post by: Legimet on November 14, 2013, 11:19:46 pm
Somes librairies like zlib are used in several ndless programs, and then included in the file each time. It could be good to add the possibility to have files like DLL.

There is bFLT shared library support in ndless (I saw the functions in the source code), but I just don't know how to make a shared library.

Lionel, I'll see if I can use the zlib in the OS later. It's not really a priority, since zlib is very tiny.
Title: Re: A viewer of PDF
Post by: mdr1 on November 22, 2013, 09:15:55 am
Sorry for the question, but how long is your program planned for?
And will the viewer include links and search abilities?
Title: Re: A viewer of PDF
Post by: Legimet on November 22, 2013, 06:34:47 pm
As I said before, I haven't had much time to work on this. I'll try to release something this weekend.
Yes, i will try to include links and search abilities, but the first version will just be a really basic viewer.
Title: Re: A viewer of PDF
Post by: critor on November 22, 2013, 06:50:00 pm
A simple viewer will already by more than enough to be a great newsworthy achievement ;)
Title: Re: A viewer of PDF
Post by: mdr1 on November 23, 2013, 07:39:00 am
Ok, thanks Legimet, it would be really great to have a first version this Week-End. :)
By the way, for a next version, I'd like to suggest to enable to open the viewer even though a "classeur" is already opened, for example with the method  critor used: a hook on "mv()" and "mvl()". (https://tiplanet.org/forum/viewtopic.php?t=11994 (https://tiplanet.org/forum/viewtopic.php?t=11994))