nini9140 / jzebra

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

PDF Print + Page Setup not ok #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a Star TSP 100 with which I would like to print out an 70mm receipt. But 
the Pagesetup has to much space on the left and right side which results in a 
very narrow printable region in the middle of the receipt.

Is there a way to change the border on left, right, top and bottom from 2,5cm 
to 0,1cm ~ 1mm ?

Original issue reported on code.google.com by den...@dujan.eu on 17 Feb 2012 at 6:13

GoogleCodeExporter commented 9 years ago
This printer seems to support ESC/P, is there a reason you are printing PDF to 
it?  I can look at advanced PDF printing options, but PDF support is only 
experimental at this point and was never intended for POS thermal printers.  
You may have better results printing raw Epson commands to it.

Original comment by tres.fin...@gmail.com on 18 Feb 2012 at 1:13

GoogleCodeExporter commented 9 years ago
I was able to reproduce this.  No matter how I set the printable area, the 
pdf-renderer plugin puts a 1" margin around the document.  This isn't obvious 
with the built-in sample because it shares the same size margins as the plugin, 
so they go unnoticed.

If you need this feature expedited, I would first need help from the 
pdf-renderer project.  If you can find a snippet that properly sets margin, 
I'll try to implement this into the printPS() functionality.

-Tres

Original comment by tres.fin...@gmail.com on 18 Feb 2012 at 3:26

GoogleCodeExporter commented 9 years ago
Experiencing this same issue with new HTML printing feature.  Any help is 
appreciated.

-Tres

Original comment by tres.fin...@gmail.com on 29 Feb 2012 at 4:14

GoogleCodeExporter commented 9 years ago
Posted the question to oracle forums.

https://forums.oracle.com/forums/thread.jspa?threadID=2353563

Original comment by tres.fin...@gmail.com on 29 Feb 2012 at 2:39

GoogleCodeExporter commented 9 years ago
Found the solution.  Will be fixed in next release.

// Elimate any margins
        HashPrintRequestAttributeSet attr = new HashPrintRequestAttributeSet();             
        attr.add(new MediaPrintableArea(0f, 0f, getWidth()/72f, getHeight()/72f, MediaPrintableArea.INCH));

-Tres

Original comment by tres.fin...@gmail.com on 3 Mar 2012 at 5:11

GoogleCodeExporter commented 9 years ago
Thanks again for this bug report.

This issue has now been addressed in 1.3.4.

http://code.google.com/p/jzebra/downloads/detail?name=jZebra%201.3.4.zip&can=2&q
=

Please post back as to whether or not it has been fixed.

-Tres

Original comment by tres.fin...@gmail.com on 13 Mar 2012 at 6:14

GoogleCodeExporter commented 9 years ago

Original comment by tres.fin...@gmail.com on 16 Mar 2012 at 6:18

GoogleCodeExporter commented 9 years ago
Fix verified by rvtecrvtec.

Original comment by tres.fin...@gmail.com on 16 Mar 2012 at 6:19

GoogleCodeExporter commented 9 years ago
We are facing similar issue while printing images PNG to be specific. There is 
a left and bit top margin gets added and image gets bit shrunk while printing. 
Any idea if its related to above fix or completely a different issue ?

Any help is appreciated.

Original comment by ashish.n...@gmail.com on 28 May 2013 at 9:10

GoogleCodeExporter commented 9 years ago
Issue 135 has been merged into this issue.

Original comment by tres.fin...@gmail.com on 28 May 2013 at 12:21

GoogleCodeExporter commented 9 years ago
@ashish: Reopening bug per request.  Can you attach a sample of before and 
after?

Original comment by tres.fin...@gmail.com on 28 May 2013 at 12:33

GoogleCodeExporter commented 9 years ago
=> Attached both image in one attached file. When we print given PNG to Printer 
through jZebra, got bit more left and upper margin and image is bit shrunk. 
Where as same PNG to Printer through picPick editor (removing all margins) got 
printed exactly as desired.

=> The attached image is a scanned paper image.

=> The printer is HP_LaserJet_1020. 

=> We are using jZebra -> Image print -> printPS(). Printing through windows 
driver of HP Laser Jet 1020 (paper size A4 as required). Note: We are not 
printing through Generic/Text as 1020 does not support raw PS printing.

Please let me know if more info. required on the above.

Thanks in advance for the help/hint on how to resolve this issue.

Original comment by ashish.n...@gmail.com on 29 May 2013 at 7:24

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks.

Can you attach a copy of an unmodified PNG?  I'd like to attempt to print this 
myself.

-Tres

Original comment by tres.fin...@gmail.com on 29 May 2013 at 2:26

GoogleCodeExporter commented 9 years ago
Sure.

As printer attached desktop is at office, I am attaching another PNG (just 
different article data/barcode, everything else is same).

Repeating the printing condition we used.... => We are using jZebra -> Image 
print -> printPS(). Printing through windows driver of HP Laser Jet 1020 (paper 
size A4 as required). Note: We are not printing through Generic/Text as 1020 
does not support raw PS printing.

Thanks again.

Original comment by ashish.n...@gmail.com on 29 May 2013 at 5:38

Attachments:

GoogleCodeExporter commented 9 years ago
@Asish:  A couple of things... 

The image you are printing was too large for my java runtime.  I had to add 
this to the applet tag to print your image:
   <applet ...>
      <!-- Increase heap space for large images, etc -->
      <param name="java_arguments" value="-Xmx1024m">
   </applet>

Once this is set, it seems to print OK.

I don't see the additional border you are referring to.

I've provided evidence of this by putting the PNG and the XPS document side by 
side.

I've attached the side-by-side as well as the XPS file.

Is there a chance this is related to the default printing behavior of your 
printer?

-Tres

Original comment by tres.fin...@gmail.com on 29 May 2013 at 6:08

Attachments:

GoogleCodeExporter commented 9 years ago
I forgot to attach my code snippet:
(JavaScript)
   applet.setPaperSize("210mm", "297mm");  // A4
   applet.setAutoSize(true);
   applet.appendImage(getPath() + "img/4705_1369809483181.png");

-Tres

Original comment by tres.fin...@gmail.com on 29 May 2013 at 6:11

GoogleCodeExporter commented 9 years ago
Correction, although I don't see the extra borders, I do see the shrinking that 
is occurring.

Comment out the line:
//applet.setPaperSize("210mm", "297mm");  // A4

This seems to correct the issue.

1.  Make sure your printer is set to A4 for paper size by default (in Printer 
Properties).

2.  Use this code:

(JavaScript)
   applet.setAutoSize(true);
   applet.appendImage(getPath() + "img/4705_1369809483181.png");

-Tres

Original comment by tres.fin...@gmail.com on 29 May 2013 at 6:23

GoogleCodeExporter commented 9 years ago
Thanks Tres for such a quick & detailed response.

Will try tomorrow with ONLY autoSize true (already tried couple of days back 
for A4 setting + autosize but didn't work).

However, few more info which is asked as above.

1. I am referring the additional left and top "margin" (space). However, that 
is not visible in your attached side by side print.
2. Yes, believe we have also increased the Heap for our program.
3. Yes, we also have set default page in printer setting as A4 (Printer setting 
also attached here for reference).
4. The printer setting were same (A4 without scale to fit - as given above) 
when we fired print from jZebra / picPick editor so issue of extra margin (left 
& top) if there with printer setting then it should also be visible for picPick 
editor printing as well. I may be missing something here, please suggest.

- Ashish

Original comment by ashish.n...@gmail.com on 29 May 2013 at 6:59

Attachments:

GoogleCodeExporter commented 9 years ago
Tried ONLY autoSize true, but got following warning.

WARNING: A paper size must be specified before setting auto-size!

Moreover, also got below info message, suggesting there is bit scalling 
happening with 72dpi (our printer dpi set as 600).

INFO: Using image at "natural" resolution  4964.0px 7016.0px scaled to 68in x 
97in (assumes 72dpi)

Original comment by ashish.n...@gmail.com on 30 May 2013 at 11:42