Pdf preview in media fields

Discuss all feature requests you have for a new Servoy versions here. Make sure to be clear about what you want, provide an example and indicate how important the feature is for you

Pdf preview in media fields

Postby Riccardino » Wed Sep 22, 2004 9:17 am

Since Dev Team is doing such a great job with image files management, I'd like to add a request to the wish list:

it would be great to to able to see a thumbnail of the first page of a pdf document, when this one is stored in a blob field.

As an alternative, also a function that creates a thumbnail in jpeg or png format would be fine.

What do you think?
ciao, ric
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby automazione » Wed Sep 22, 2004 9:33 am

I also REALLY need this feature!. THANK YOU IN ADVANCE DEV DREAM TEAM!!!

....and what about an easy way to display the blob-pdf directly on a form?
Enrico Arata
Servoy Italia
automazione
 
Posts: 366
Joined: Thu Apr 24, 2003 11:37 am
Location: Torino, Italy

Postby jcompagner » Fri Sep 24, 2004 3:15 pm

here is a pdf bean that you can drop in the beans folder.

loading of a pdf:

Code: Select all
globals.page = 1;
globals.zoomfactor = 0.2;
var file = plugins.file.showFileOpenDialog(1);
if(file)
{
   elements.bean_185.openPdfFile(file);
   elements.bean_185.decodePage(globals.page);
   elements.bean_185.setPageParameters(globals.zoomfactor, globals.page);
   elements.bean_185.repaint();
}


next page:

Code: Select all
globals.page++;
elements.bean_185.decodePage(globals.page);
elements.bean_185.setPageParameters(globals.zoomfactor, globals.page);
elements.bean_185.repaint();
Attachments
jpedal.jar
(808.76 KiB) Downloaded 1022 times
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8884
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Riccardino » Fri Sep 24, 2004 7:33 pm

jcompagner wrote:here is a pdf bean that you can drop in the beans folder.


Guys, you're really great! :-D

Thanks: it's a precious tool and I can't wait to use it :-)
ciao, ric
User avatar
Riccardino
 
Posts: 911
Joined: Thu Apr 24, 2003 11:42 am
Location: Ferrara, Italy

Postby automazione » Sat Sep 25, 2004 12:10 am

THANKS JOHAN. that was a really quick response!! IT WORKS!!! it is exactly what I was looking for. WONDERFUL !!!

TO all members of this forum
    TAKE NOTE: Our was not an easy request ... but SERVOY dev DREAM team found and tested the right solution for us in less than 3 days!!!!

I owe you a big box of Torino's GIANDUJOTTI.

GRAZIE
Enrico Arata
Servoy Italia
automazione
 
Posts: 366
Joined: Thu Apr 24, 2003 11:37 am
Location: Torino, Italy

Postby automazione » Sat Sep 25, 2004 12:15 am

For loading a pdf from a blob field:

Code: Select all
elements.bean_185.openPdfArray(blob_pdf)


where blob_pdf is the media/blob field.

WONDERFUL

thanks again
Enrico Arata
Servoy Italia
automazione
 
Posts: 366
Joined: Thu Apr 24, 2003 11:37 am
Location: Torino, Italy

Postby Harjo » Sat Sep 25, 2004 10:04 am

VERY COOL STUFF! :D
Harjo Kompagnie
byKom B.V.
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Ron » Sun Sep 26, 2004 11:59 am

Sorry, I can't get it working :oops:
Installed the bean, placed the bean on a form, created a mediafield and pasted a PDF in it, and the two globals.
Finally I made a method and pasted the code in it.
What do I put into the methods (pdf from a blobfield as well as from outside the db)?

TIA

Ron
Ron
 
Posts: 315
Joined: Fri May 23, 2003 12:30 am
Location: Netherlands

Postby pbakker » Sun Sep 26, 2004 12:41 pm

The methods work with the element name of the beanelement you dropped on your form. Did you name the element and synced the element name used in the methods to it?

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby Ron » Sun Sep 26, 2004 2:12 pm

Hi Paul,

Yep, I did rename the beannames in my method, that was not the problem.
I did set the zoomfactor 2 and enlarged the bean size, and now
the pdf from my HD shows up fine.
However I am still struggling with de pdf stored in the mediafield.
This is the code I use:

globals.page = 1;
globals.zoomfactor = 2;
var file = elements.bean_185.openPdfArray(pdf_in_mediafield);
if(file)
{
elements.bean_185.openPdfFile(file);
elements.bean_185.decodePage(globals.page);
elements.bean_185.setPageParameters(globals.zoomfactor, globals.page);
elements.bean_185.repaint();
}


Any suggestions?
Ron
 
Posts: 315
Joined: Fri May 23, 2003 12:30 am
Location: Netherlands

Postby jcompagner » Sun Sep 26, 2004 2:28 pm

you are using BOTH pdf from file and pdf from array!!
you shouldn't ofcourse use both!

var file = elements.bean_185.openPdfArray(pdf_in_mediafield);

elements.bean_185.openPdfFile(file);

if you debugged this then you should see that file after the first call is undefined.. Is nothing. Because openPdfArray doesn't return a file.. It shows the pdf that is defined in the array. Just as openPdfFile shows the pdf defined in the file object...


Code: Select all
elements.bean_185.openPdfArray(pdf_in_mediafield);
elements.bean_185.decodePage(globals.page);
elements.bean_185.setPageParameters(globals.zoomfactor, globals.page);
elements.bean_185.repaint(); 
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8884
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Ron » Sun Sep 26, 2004 3:14 pm

You're right.
Thanks Johan.
Ron
 
Posts: 315
Joined: Fri May 23, 2003 12:30 am
Location: Netherlands

Postby idoctor » Tue Nov 30, 2004 12:36 am

Is thier a way to use this bean to add and position text. ie) For instance to programatically fill out a form?

John McCann
idoctor
 
Posts: 254
Joined: Sun Sep 28, 2003 6:37 pm

Postby idoctor » Tue Nov 30, 2004 12:37 am

Is thier a way to use this bean to add and position text. ie) For instance to programatically fill out a form?

John McCann
idoctor
 
Posts: 254
Joined: Sun Sep 28, 2003 6:37 pm

Postby Jan Blok » Wed Dec 01, 2004 6:36 pm

No not possible but maybe we could build a merge function for PDF forms based on the lib used by the pdf printer plugin
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Next

Return to Discuss Feature Requests

Who is online

Users browsing this forum: No registered users and 4 guests