|
|
PDF reader for Photon GUI
|
|
04/24/2012 12:31 PM
post92726
|
PDF reader for Photon GUI
If someone interested, there is a new version (first public) of PDF reader for Photon/QNX6.5 for x86 platform.
Binaries and sources can be downloaded here https://github.com/llmike/PhMuPDF/downloads
If someone interested to build mupdf engine with PDF reader for Photon, I can explain how to do this.
I have been doing this project for myself since 2010. I'm using self-hosted QNX and very often need to read numerous PDF
documents under QNX. I hope you will find this application useful too :)
Thanks.
|
|
|
|
|
|
|
RE: PDF reader for Photon GUI
|
|
04/24/2012 4:59 PM
post92731
|
RE: PDF reader for Photon GUI
Thanks!!!!!
> -----Message d'origine-----
> De : Mike Gorchak [mailto:community-noreply@qnx.com]
> Envoyé : 24 avril 2012 12:31
> À : photon-graphics
> Objet : PDF reader for Photon GUI
>
> If someone interested, there is a new version (first public) of PDF reader for
> Photon/QNX6.5 for x86 platform.
>
> Binaries and sources can be downloaded here
> https://github.com/llmike/PhMuPDF/downloads
>
> If someone interested to build mupdf engine with PDF reader for Photon, I can
> explain how to do this.
>
> I have been doing this project for myself since 2010. I'm using self-hosted QNX
> and very often need to read numerous PDF documents under QNX. I hope you
> will find this application useful too :)
>
> Thanks.
>
>
>
>
> _______________________________________________
>
> Photon microGUI
> http://community.qnx.com/sf/go/post92726
>
|
|
|
|
|
|
|
RE: PDF reader for Photon GUI
|
|
04/25/2012 9:00 AM
post92737
|
RE: PDF reader for Photon GUI
excellent!
-----Original Message-----
From: Mike Gorchak [mailto:community-noreply@qnx.com]
Sent: April 24, 2012 12:31 PM
To: photon-graphics
Subject: PDF reader for Photon GUI
If someone interested, there is a new version (first public) of PDF reader for Photon/QNX6.5 for x86 platform.
Binaries and sources can be downloaded here https://github.com/llmike/PhMuPDF/downloads
If someone interested to build mupdf engine with PDF reader for Photon, I can explain how to do this.
I have been doing this project for myself since 2010. I'm using self-hosted QNX and very often need to read numerous PDF
documents under QNX. I hope you will find this application useful too :)
Thanks.
_______________________________________________
Photon microGUI
http://community.qnx.com/sf/go/post92726
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
08/07/2012 8:40 AM
post94670
|
Re: PDF reader for Photon GUI
I downloaded the src at the link. However I am not able to build the same. Kindly tell me the steps .
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
08/16/2012 5:44 AM
post94876
|
Re: PDF reader for Photon GUI
Hi,
You have to obtain generic sources for mupdf at http://git.ghostscript.com/?p=mupdf.git;a=summary , please use version 1
.0, not latest sources. Or just download 1.0 snapshot at http://code.google.com/p/mupdf/downloads/detail?name=mupdf-1.0-
source.tar.gz&can=2&q= . Extract my sources to the directory with mupdf sources. Type "make -f Makefile.qnx". Enjoy.
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
09/26/2012 8:40 AM
post95833
|
Re: PDF reader for Photon GUI
Hi,
I downloaded the image 1.0 and palced your code(obtained from https://github.com/llmike/PhMuPDF/downloads)
During make I got the following errors-
fitz/image_jpx.c: In function 'fz_load_jpx':
fitz/image_jpx.c:27: error: 'opj_event_mgr_t' undeclared (first use in this function)
fitz/image_jpx.c:27: error: (Each undeclared identifier is reported only once
fitz/image_jpx.c:27: error: for each function it appears in.)
fitz/image_jpx.c:27: error: expected ';' before 'evtmgr'
etc ...
The details are attached in the snapshot.
Kindly help on this. I am running this in the /MuPdf directory on QNX 6 Self Hosted machine.
Regards,
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
09/27/2012 5:03 AM
post95871
|
Re: PDF reader for Photon GUI
Hi Mike,
The PDF Reader is excellent Thanks a lott for this.
I am building the source code for which I had put a query previously. Also I had executed the binary provided by you.
I had a query regarding this .
I executed this on my self hosted machine.
I am trying to execute the same exe on another machine where the difrence is in binaries and libs in the /usr/bin and /
usr/lib and other system folder. The binary does not run and gves a memory fault.I am able to run other photon
applications on my machine.
I suspect some library dependency specific to this binary which is not being met.
Could you tell me the library or other dependencies this executable has.This would be very helpull.
Regards,
|
|
|
|
|
|
|
RE: PDF reader for Photon GUI
|
|
09/27/2012 8:59 AM
post95877
|
RE: PDF reader for Photon GUI
Use:
DL_DEBUG=libs your_app
It will tell if any libs are missing.
-----Original Message-----
From: Kapil Gadgil [mailto:community-noreply@qnx.com]
Sent: September-27-12 5:03 AM
To: photon-graphics
Cc: neha6.b@tcs.com
Subject: Re: PDF reader for Photon GUI
Hi Mike,
The PDF Reader is excellent Thanks a lott for this.
I am building the source code for which I had put a query previously. Also I had executed the binary provided by you.
I had a query regarding this .
I executed this on my self hosted machine.
I am trying to execute the same exe on another machine where the difrence is in binaries and libs in the /usr/bin and /
usr/lib and other system folder. The binary does not run and gves a memory fault.I am able to run other photon
applications on my machine.
I suspect some library dependency specific to this binary which is not being met.
Could you tell me the library or other dependencies this executable has.This would be very helpull.
Regards,
_______________________________________________
Photon microGUI
http://community.qnx.com/sf/go/post95871
To cancel your subscription to this discussion, please e-mail photon-graphics-unsubscribe@community.qnx.com
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
09/27/2012 9:31 AM
post95879
|
Re: PDF reader for Photon GUI
> I am building the source code for which I had put a query previously. Also I
> had executed the binary provided by you.
If you are still experiencing problems with building, I uploaded 1.1 version to github and you can obtain generic 1.1
version at http://code.google.com/p/mupdf/downloads/detail?name=mupdf-1.1-source.tar.gz&can=2&q= and then we will try to compile it at both sides step by step.
> I am trying to execute the same
exe on another machine where the difrence is
> in binaries and libs in the /usr/bin and /usr/lib and other system folder.
If you have noticed, the archive mupdf-1.0-src.tar.gz as well as mupdf-1.1-src.tar.gz contain 3rdparty directory, which
has headers and pre-compiled static libraries of all things, which are required to build phmupdf on QNX:
libz.a
libpng15.a
libopenjpeg.a
libjpeg.a
libjbig2dec.a
libfreetype.a
libbz2.a
Final phmupdf binary only depends on:
1) libph.so.3
2) libm.so.2
3) libc.so.3
4) libfont.so.1
which are all QNX system libraries, available even in runtime only installation.
> The binary does not run and gves a memory fault.I am able to run other photon
> applications on my machine.
> I suspect some library dependency specific to this binary which is not being
> met.
How phmupdf binary was copied to this machine ? If through the network, like FTP, please make sure that binary transfer
mode has been enabled before.
Could you check checksum of both binaries with cksum utility: "cksum phmupdf"?
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
09/28/2012 12:19 AM
post95906
|
Re: PDF reader for Photon GUI
Hi Mike,
Thanks for the details.It was helpfull.
I checked the libraries,executable , everything seems to be ok.
Does this Reader run on QNX 6.4.0 . I was excuting this on 6.5 and 6.4.0 . The issue is with 6.4.0
In case this wont execute on 6.4 then do you have any previous version of this reader that is compatible with 6.4
Regards,
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
09/28/2012 4:20 AM
post95907
|
Re: PDF reader for Photon GUI
> Thanks for the details.It was helpfull.
> I checked the libraries,executable , everything seems to be ok.
>
> Does this Reader run on QNX 6.4.0 . I was excuting this on 6.5 and 6.4.0 . The
> issue is with 6.4.0
> In case this wont execute on 6.4 then do you have any previous version of this
> reader that is compatible with 6.4
It works for me on 6.4.1 and 6.5. But I think it must be re-complied under 6.4.0 to get it working. GUI of the reader
uses alpha blending for icons to show soft shadows under the picture. Looks at the bottom of gear icon, for example. I
do not remember if 6.4 supports alpha blending through the PhImage_t settings or not.
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
10/05/2012 4:03 AM
post96049
|
Re: PDF reader for Photon GUI
Hi Mike,
I have built it on QNX 6.4.0 and its great.
There were a few compilation errors ,however i fixed it and the binary is running great.
Currently I am trying to improve its performance on our machine.
Please do share your inputs too.
Regards,
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
10/15/2012 3:59 AM
post96319
|
Re: PDF reader for Photon GUI
> I have built it on QNX 6.4.0 and its great.
> There were a few compilation errors ,however i fixed it and the binary is
> running great.
Great!
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
11/01/2012 7:44 AM
post96744
|
Re: PDF reader for Photon GUI
Hi Mike,
I cannot scroll horizontally in this binary. I read from a few sources that h j k l are shortcut keys to scroll
horizontally in MuPDF Viewer.
Are there any other keys to horizontally scroll the document or a horizontal scroll bar needs to be implemented through
code.
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
11/07/2012 3:25 AM
post96927
|
Re: PDF reader for Photon GUI
Hi Mike,
I have implemented horizontal scrollbar using PtScrollContainer and it works fine.
Please tell me where in the code has Home ,End , page Up ,page down ,arrow up and down event been handled.
I went through the code but couldn't find it.
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
12/05/2012 2:05 AM
post97792
|
Re: PDF reader for Photon GUI
Hi Mike,
Are there any licence issues with this PDF Reader/code for commercial purpose????
Regds,
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
01/15/2013 1:25 PM
post98586
|
Re: PDF reader for Photon GUI
> Hi Mike,
> Are there any licence issues with this PDF Reader/code for commercial purpose
> ????
> Regds,
Sorry for delay, I have not checked this thread :) My sources have Apache 2 license, while all mupdf sources are using
GPL v3 license. I'm afraid you have to provide the sources together with binary distribution. Please read the GPL v3
license for more details.
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
01/15/2013 1:28 PM
post98587
|
Re: PDF reader for Photon GUI
> Hi Mike,
>
> I have implemented horizontal scrollbar using PtScrollContainer and it works
> fine.
>
> Please tell me where in the code has Home ,End , page Up ,page down ,arrow up
> and down event been handled.
> I went through the code but couldn't find it.
All these keys are handled by vertical scrollbar widget (inside a widget).
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
01/09/2013 6:42 PM
post98468
|
Re: PDF reader for Photon GUI
Mike,
I am interested in using the PDF reader in a slightly modified way. I downloaded the source, but could not find
an easy way to "make" it. Is something intentionally missing?
Thanks,
Mitchell
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
01/15/2013 1:29 PM
post98588
|
Re: PDF reader for Photon GUI
> Mike,
>
> I am interested in using the PDF reader in a slightly modified way. I
> downloaded the source, but could not find an easy way to "make" it. Is
> something intentionally missing?
I answered directly to your mail. Thanks.
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
01/22/2013 4:55 AM
post98715
|
Re: PDF reader for Photon GUI
Hi Mike,
I am able to use Phmudf with generic source 1.0 dowloaded from http://code.google.com/p/mupdf/downloads/detail?name=
mupdf-1.0-source.tar.gz&can=2&q= and the phmupdf source code provided by you.
However phmupdf consumes a lot of heap and shared memory on scroll and zoom operations.It may be a possible memory leak.
Are there any possible fixes for these in generic muPDF1.1 or there may be some other reasons.
Thanks ...
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
01/22/2013 3:57 PM
post98734
|
Re: PDF reader for Photon GUI
> Are there any possible fixes for these in generic muPDF1.1 or there may be
> some other reasons.
There no memory leaks, as far as I know.
PhMuPDF consumes about 256Mb of RAM for cache, you can change this value in the main() function of phmupdf.c module:
application.settings.cache_size=FZ_STORE_DEFAULT;
FZ_STORE_DEFAULT is equal to 256Mb.
Also you can change PHMUPDF_RENDER_MAX_IMAGES macro in the phmupdf.h module. Default value is 16, so 16 offscreen/memory
contexts will be used to hold 16 pages of document, usually adjacent or last viewed pages. Minimum value is 4. Each
cached page can consume 4-8Mb depending on size of PhMuPDF window or zoom value.
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
01/23/2013 7:02 AM
post98742
|
Re: PDF reader for Photon GUI
Hi Mike,
Thanks for the inputs.
I tried the options as cache size reduced to 8 MB and
PHMUPDF_RENDER_MAX_IMAGES 4 and also reduced anti-aliasing to 4.
However I can still see a total memory usage upto ~30 MB on zooming and scrolling operations.
Can the memory usage of the application be further reduced as our system is supplied with low memory. Can it be
restricted to ~20 MB max.
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
01/29/2013 2:06 PM
post98875
|
Re: PDF reader for Photon GUI
> Can the memory usage of the application be further reduced as our system is
> supplied with low memory. Can it be restricted to ~20 MB max.
Really, I do not know. As far as I remember upcoming mupdf 1.2 has some improvements regarding memory usage, but I would
not have entertained little hope. 30Mb is a very good memory usage for such kind of applications like PDF reader.
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
02/06/2013 7:33 AM
post99106
|
Re: PDF reader for Photon GUI
Hi Mike,
I understand that such Applications require large amount of memory, but there should be some upper limit.
As I see in current phmupdf is that on scrolling operations on high zoom level the memory usage keeps on increasing and
never stops until my application crashes.
Thanks
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
02/13/2013 6:38 AM
post99247
|
Re: PDF reader for Photon GUI
Hi Mike,
After debugging phmupdf on our QNX system , we found that the call PhCreateImage() in phpdf_load_page() was failing and
returning NULL.due to which phmupdf crashed.
This was happening during continous zoom operations.
As a solution to this , can I put a check in phpdf_load_page() to check for PhCreateImage() to return NULL and in this
case I may revert back to the previous zoom level.What all structures I may have to clear and handle.Attaching the
conditional statement :
if(NULL != app->page_image[slotno].page_image_phi)
{
printf("pointer not null\n");
temp_ptr=app->page_image[slotno].page_image_phi->image;
w=app->page_image[slotno].page_image_phi->size.w;
h=app->page_image[slotno].page_image_phi->size.h;
pitch=app->page_image[slotno].page_image_phi->bpl;
}
else
{
printf("NULL Image!!!!! Cannot allocate memory\n");
//Return to previous zoom level
}
Also in some cases of scrolling and zoom I observed the fitz library function fz_malloc_array() throwing an exception
for not enough memory(). Can you pinpoint me the exact scenario when the memory is allocated using this function.
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
02/14/2013 7:51 AM
post99277
|
Re: PDF reader for Photon GUI
> As a solution to this , can I put a check in phpdf_load_page() to check for
> PhCreateImage() to return NULL and in this case I may revert back to the
> previous zoom level.What all structures I may have to clear and handle.
> Attaching the conditional statement :
What video card and what graphics driver you using? Maybe it would be a good solution to use offscreen video memory
instead of system shared memory? It will be much faster and will leave system memory almost untouched.
> Also in some cases of scrolling and zoom I observed the fitz library function
> fz_malloc_array() throwing an exception for not enough memory(). Can you
> pinpoint me the exact scenario when the memory is allocated using this
> function.
fz_malloc_*() is used everywhere in the fitz library. Each page rendering operation calls numerous fz_malloc_*()
functions.
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
02/25/2013 4:13 AM
post99499
|
Re: PDF reader for Photon GUI
Hi Mike,
I tried enabling offscreen memory context and I do see an improvement in memory usage.
However the horizontal scroll functionality which I implemented using PtScrollContainer stopped working.
Only the PtPane gets scrolled instead of the whole drawing area.Following is the code I used to create scroll container.
app->phwindow=PtCreateWidget(PtWindow, Pt_NO_PARENT, winargc, winargs);
/* Create PtOSContainer widget for flicker-free updating */
PtSetArg(&winargs[winargc++], Pt_ARG_DIM, &app->window.dimension, 0);
app->phoscontainer=PtCreateWidget(PtOSContainer, app->phwindow, winargc, winargs);
/*Create ScrollContainer for Horizontal Scroll in This Application*/
winargc=0;
PtSetArg(&winargs[winargc++], Pt_ARG_DIM, &app->window.dimension, 0);
PtSetArg(&winargs[winargc++], Pt_ARG_SCROLLBAR_Y_DISPLAY, Pt_NEVER, 0);//Vertical Scroll bar is not displayed as it
is already implemented.
app->scrollarea=PtCreateWidget(PtScrollContainer, app->phoscontainer, winargc, winargs);
/* Create PtRaw widget for drawings */
winargc=0;
PtSetArg(&winargs[winargc++], Pt_ARG_DIM, &app->window.dimension, 0);
PtSetArg(&winargs[winargc++], Pt_ARG_FILL_COLOR, PgRGB(0x70, 0x70, 0x70), 0);
PtSetArg(&winargs[winargc++], Pt_ARG_RAW_DRAW_F, phmupdf_draw_content, 0);
PtSetArg(&winargs[winargc++], Pt_ARG_POINTER, (void*)app, 0);
raw_cb.event_mask=Ph_EV_BUT_PRESS | Ph_EV_PTR_MOTION_BUTTON |
Ph_EV_PTR_MOTION_NOBUTTON | Ph_EV_BOUNDARY;
raw_cb.event_f=phmupdf_content_callback_raw;
raw_cb.data=(void*)app;
PtSetArg(&winargs[winargc++], Pt_CB_RAW, &raw_cb, 0);
/* Create the PtRaw widget */
app->phcontent=PtCreateWidget(PtRaw, app->scrollarea, winargc, winargs);
Does it have any relation of scroll container created on PtOSContainer and offscreen-memory context enabled at the same
time?
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
02/25/2013 10:35 AM
post99513
|
Re: PDF reader for Photon GUI
> Does it have any relation of scroll container created on PtOSContainer and
> offscreen-memory context enabled at the same time?
No, PtOSContainer is used just for non-flickering graphics update. I think problem could be in blitting from offscreen
memory to PtOSContainer, since I have not implemented horizontal scrolling, it can be an issue.
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
02/26/2013 7:50 AM
post99535
|
Re: PDF reader for Photon GUI
Hi Mike,
Thanks for the comments.However to avoid PtScrollContainer I was trying to implement the horizontal scroll bar itself.
Can you give me the pointers as to how I can target it.
Thanks
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
02/26/2013 2:21 PM
post99554
|
Re: PDF reader for Photon GUI
> Thanks for the comments.However to avoid PtScrollContainer I was trying to
> implement the horizontal scroll bar itself. Can you give me the pointers as to
> how I can target it.
I planned to add text selection/copying and horizontal scrolling using mupdf 1.2 engine, which must come out soon. It is
a matter of one/two weekends to do this :)
If you like to do this yourself, take a look into the phmupdf_draw_content() function, there one variable called offset,
it is y-offset of the page, you have to implement x-offset using the same algorithms. And also you have to unlock zoom
levels, currently maximum zoom level is calculated using fitting page to the window dimensions.
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
03/06/2013 11:47 PM
post99722
|
Re: PDF reader for Photon GUI
Hi Mike,
Thanks for the inputs.I'll try implementing it.Also it would be great if you could upload the code soon.
Thanks..
|
|
|
|
|
|
|
Re: PDF reader for Photon GUI
|
|
04/08/2013 3:21 AM
post100363
|
Re: PDF reader for Photon GUI
Hi Mike,
Did you get a chance to work on horizontal scrolling.
It would be great if you could upload the code soon.
Thanks
|
|
|
|
|
|