ramonlopes / jzebra

Automatically exported from code.google.com/p/jzebra
0 stars 0 forks source link

Get the printer paper width adapt to the layout of the different thermal paper #211

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.By judging the paper width to get print output layout responsive.this is kind 
of a requirement.
2.
3.

What is the expected output? What do you see instead?
I want to call Java API to get printer's paper width,but i don't found this 
method in jZebra

What version of the product are you using? On what operating system?
jZebra Version :I use the latest version(1.8.0)
Os Type : windows 7 X64

Please provide any additional information below.

Original issue reported on code.google.com by acmoo...@gmail.com on 10 Mar 2014 at 2:35

GoogleCodeExporter commented 8 years ago
Yes, this is a well needed feature.  It's not currently available.

I would consider filing a bug for version 2.0.0, since 1.8.0 will only be 
patched for critical bugs.

https://github.com/qzindustries/qz-print

-Tres

Original comment by tres.fin...@gmail.com on 10 Mar 2014 at 2:46

GoogleCodeExporter commented 8 years ago
Thanks for reply!
When will you release new version with this feature?
And whether I can add the corresponding code using this feature?

Original comment by acmoo...@gmail.com on 10 Mar 2014 at 4:06

GoogleCodeExporter commented 8 years ago
The features have been prioritized based on our premium subscribers needs as 
well as popular demand.  If you file the enhancement on GitHub we can try to 
make it available by 2.0.0.  If it is added, you will get notification that the 
enhancement is closed.

I encourage you to propose your own usage examples.  I cannot make any 
guarantee as to the speed in which this particular enhancement is completed.  I 
hope that is ok. 

Original comment by tres.fin...@gmail.com on 10 Mar 2014 at 4:19

GoogleCodeExporter commented 8 years ago
I add this named 'getPaperWidth' method in printApplet.java and compiling 
successed,self-signed successed.When i open sample.html use the changed jar 
file instead of original jar file,it doesn't load applet success.
Would you please tell me why?

Original comment by acmoo...@gmail.com on 10 Mar 2014 at 7:58

GoogleCodeExporter commented 8 years ago
@acmookey,

This could be for several reasons, most of which won't be easy to troubleshoot 
over google code.  Can you get a hold of me on hangouts?  Also, if you fork 
2.0.0 and work from that I would be able to see your changes as you commit them 
back to GitHub, and accept your changes into master branch, etc.

-Tres

Original comment by tres.fin...@gmail.com on 10 Mar 2014 at 12:41

GoogleCodeExporter commented 8 years ago
I changed the PrintApplet.java in attach file(version 1.8.0 source file) on 
location line 48 to 55 and line 1313 to 1331.
I neither familiar with the usage of ANT,nor GitHub; I just use this Java 
applet as plug-in of nodejs project.It would be nice if you can help me to 
compiling this changed file and self-signed it and email to me?
Thank you very much!

Original comment by acmoo...@gmail.com on 11 Mar 2014 at 7:23

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for your contribution, it's greatly appreciated.  You seem to be using 
GitHub well. :)

Unfortunately, what you're trying to do generally requires elevation and the 
Security Manager doesn't like Java iterating over privileged functions directly 
called by JavaScript.  Java cares what fires each event, and it's for this 
reason that there aren't many applet that do printing like qz-print does (and 
has the unintended effect of making changes more than a few lines of code). 
This is a security measure that Java takes to help prevent malicious scripting 
and the applet has been carefully constructed as to preform all privileged 
functions from the listener thread.  What this means is these attributes should 
probably be gathered at search time (which is done asynchronously by 
PrintServiceMatcher.java) and then retrieved safely once we know the printer 
list has been populated by the listener thread.  This means ALL printers will 
gather these properties, which could hinder performance, so there should 
generally be a Boolean flag as to gather these or not.

There is already a Boolean flag to log printer features on print for this 
reason, it can trigger firewalls and antivirus software to blindly iterate 
through printer properties.

I know this isn't the answer you were hoping for... 

If you have time to dig a little deeper, we can escalate this issue, but these 
changes take time and I've made some commitments to other clients that are 
weighing a bit higher at this moment so I won't be able to get to it for some 
time.

Original comment by tres.fin...@gmail.com on 11 Mar 2014 at 3:25