|
I'm building kiosk software where we need to be able to display a PDF file. Because this is a kiosk, there is no user interaction which means that it is filled with issues. What do you do with multiple pages, we are displaying on a plasma so the aspect ratio is wrong which means there will be black bars, we'd like to not have any menus since they take up real estate.
So does anybody have any ideas? One we came up with was to convert the document to jpgs, one page per image, and then scroll through them. This works but the library I looked at (http://www.aspose.com/) is slow (about 2 seconds a page).
I've also looked at the Adobe ActiveX control (just started looking at it) but we've had issues before where Adobe wants to update itself and puts a message on the screen.
So does anybody have any suggestions/thoughts on this?
TIA - Jeff.
|
|
|
|
|
Just a thought...
jbradshaw wrote: One we came up with was to convert the document to jpgs, one page per image, and then scroll through them. This works but the library I looked at (http://www.aspose.com/) is slow (about 2 seconds a page).
Is the PDF generated dynamically by software you don't control? Can you just create the JPEG's in advance (once, when you write the software), then display those and not have to worry about PDF's? And why does speed matter that much? Can't you just convert the PDF in advance (i.e., right before it's needed), then you'll have each page as a JPEG to scroll as you please? Also, any reason you chose JPEG? Do your PDF's contain natural type images (e.g., photography), or does it contain just text? If just text, PNG may be a more ideal format (lossless and compresses very well with computer generated images).
I did some Googling and came across ImageMagick, which apparently converts images and supports PDF as an input format (note that, for PDF's, it says it requires Ghostscript).
|
|
|
|
|
If Aspose is too slow, here's another library you might want to try: GDPicture.NET[^]
I haven't used it in any projects yet, but I did try it for a proof-of-concept to create a pdf from a composite image. It wasn't too hard to use and got the job done.
|
|
|
|
|
Turns out you can use the Adobe ActiveX as long as the Reader is installed on the machine.
Does everything I need.
Thanks everybody.
Jeff.
|
|
|
|
|
hey, I had a cross thread exception...
then i rewrite the problematic part to the next one
private void calculateEuclidianThread()
{
CalculateDistance euclidianKNN = new EuclideanDistance_KNN();
euclidianKNN.stLabel += delegate(object sender, string className)
{
string[] s = className.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
if (dataGridView2.InvokeRequired)
dataGridView2.Invoke(new MethodInvoker(delegate
{
dataGridView2.Rows.Add((object[])s);
}));
};
euclidianKNN.calculateDis(trainingSet, testSet);
}
but now it stucks when the event rises
what is the problem here ?
thanks
|
|
|
|
|
igalep132 wrote: now it stucks when the event rises
You'll have to do better than this. Coherently describe the problem and what is happening, including and exceptions.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
as i wrote before, the exception was
Cross-thread operation not valid: Control '' accessed from a thread other than the thread it was created on repair doesnt work
(i've dataGridView control which i tried to fill from thread i created...)
then i rewrite it (as it was posted in the first message)
and now no exception for the cross thread... but when the following line
dataGridView3.Invoke(new MethodInvoker(delegate
{
dataGridView3.Rows.Add((object[])s);
}));
is executed, the whole application freezes.
|
|
|
|
|
igalep132 wrote: the whole application freezes.
More descriptive then "it stucks"
Why are you even bothering with this? Bind the grid to a datasource and update the datasource, not the grid.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
i'm not familiar much with whole binding stuff,
i'll be glad to learn but i haven't mentioned that the data is actually some computation result which is calculated during the run time
can i bind this kind of source ?
and, if you can' please explain me what was the problem with the invoker ?
thanks
edit
|
|
|
|
|
igalep132 wrote: i'll be glad to learn
Then do so and quite possibly you will be able to answer your own question.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
what exactly i need to look for ?
and again, i would like to know what was wrong with the invoker ?
|
|
|
|
|
igalep132 wrote: what exactly i need to look for ?
DATABINDING
Does that help?!?
igalep132 wrote: what was wrong with the invoker ?
It is unnecessary! Learn to use the tools and techniques properly rather than trying to force something to make it work.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
thanks for being so angry...
|
|
|
|
|
ok, it still doesn't help !!
i still get the Cross-thread operation not valid: Control... exception when i'm trying to bind the dataGridView with the dataSet
so what should i do now ?
|
|
|
|
|
What do you mean by "it stucks when the event rises"? You sure it gets stuck and just doesn't add the row? In particular:
dataGridView2.Invoke(new MethodInvoker(delegate
{
dataGridView2.Rows.Add((object[])s);
}));
That code will never be fired if invoke is not required (that is, if dataGridView2.InvokeRequired is set to false). What you need is an "else" condition. See here for more information.
|
|
|
|
|
but in my case, invoke required, i'm running from different thread...
|
|
|
|
|
Ok, but you didn't answer my question. Answer that and maybe I can assist you.
|
|
|
|
|
i mean that the gui freezes...
|
|
|
|
|
Hmm, can you post a complete example to reproduce your problem? That way, I can debug it on my local computer and maybe give you some insight.
Until then, try this. Replace these:
dataGridView2.InvokeRequired
dataGridView2.Invoke
with these:
this.InvokeRequired
this.Invoke
Not sure that will work, but it's worth a try.
|
|
|
|
|
this.InvokeRequired<br />
this.Invoke doesn't work (i don't need invoke "this" object)
and about examp
give me your email, and i'll send it to you
|
|
|
|
|
I'm not going to give you my email address and I'm not going to run already compiled code. Create a simple example and paste the code here.
|
|
|
|
|
Hi codeproject World !
How can i convert string to decimal and remove unused Zero .
example :
string decimal = "192.0205000";
Decimal D = Decimal.Parse(decimal);
and wanna to have :
D = 192.0205
NOT D= 192.0205000
PLZ HELP !
|
|
|
|
|
And what is this code doing? Did even tried this?
|
|
|
|
|
Yes
it returns :
D= 192.0205000
BUT I wanna
<code>D= 192.0205 ====> Without unUsed Zeros</code>
|
|
|
|
|
Either strip the zeros off the string or use Math.Round
I know the language. I've read a book. - _Madmatt
|
|
|
|