Skip to content

Commit

Permalink
improvements to storeCustomChar to improve print quality for images
Browse files Browse the repository at this point in the history
  • Loading branch information
jbergen committed Mar 2, 2012
1 parent 9ae86ba commit 399961a
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 49 deletions.
Binary file modified bin/ESCPos/ESCPos.class
Binary file not shown.
Binary file modified distribution/ESCPos-0.1.1/download/ESCPos-0.1.1.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion distribution/ESCPos-0.1.1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h1>ESCPos</h1>
<div id="about">
<h2>ESCPos</h2>
<p>
A library by <a href="##yourLink##">Joseph Bergen</a> for the programming environment <a href="http://www.processing.org" target="_blank">processing</a>. Last update, 09/29/2011.
A library by <a href="##yourLink##">Joseph Bergen</a> for the programming environment <a href="http://www.processing.org" target="_blank">processing</a>. Last update, 03/02/2012.
</p>
<p>
Feel free to replace this paragraph with a description of the library. Contributed libraries are developed, documented, and maintained by members of the Processing community. Further directions are included with each library. For feedback and support, please post to the Discourse. We strongly encourage all libraries to be open source, but not all of them are.
Expand Down
33 changes: 26 additions & 7 deletions distribution/ESCPos-0.1.1/reference/ESCPos/ESCPos.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Thu Sep 29 15:00:46 EDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Fri Mar 02 14:58:37 EST 2012 -->
<TITLE>
ESCPos (Javadocs: ESCPos)
</TITLE>

<META NAME="date" CONTENT="2011-09-29">
<META NAME="date" CONTENT="2012-03-02">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">

Expand Down Expand Up @@ -169,15 +169,15 @@ <H2>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../ESCPos/ESCPos.html#cut()">cut</A></B>()</CODE>
<TD><CODE><B><A HREF="../ESCPos/ESCPos.html#beep()">beep</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../ESCPos/ESCPos.html#cutAndFeed(int)">cutAndFeed</A></B>(int&nbsp;feed)</CODE>
<TD><CODE><B><A HREF="../ESCPos/ESCPos.html#cut()">cut</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
Expand All @@ -201,6 +201,14 @@ <H2>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../ESCPos/ESCPos.html#feedAndCut(int)">feedAndCut</A></B>(int&nbsp;feed)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../ESCPos/ESCPos.html#printAndFeed(java.lang.String, int)">printAndFeed</A></B>(java.lang.String&nbsp;str,
int&nbsp;feed)</CODE>

Expand Down Expand Up @@ -784,10 +792,21 @@ <H2>
</DL>
<HR>

<A NAME="cutAndFeed(int)"><!-- --></A><H3>
cutAndFeed</H3>
<A NAME="feedAndCut(int)"><!-- --></A><H3>
feedAndCut</H3>
<PRE>
public void <B>feedAndCut</B>(int&nbsp;feed)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="beep()"><!-- --></A><H3>
beep</H3>
<PRE>
public void <B>cutAndFeed</B>(int&nbsp;feed)</PRE>
public void <B>beep</B>()</PRE>
<DL>
<DD><DL>
</DL>
Expand Down
4 changes: 2 additions & 2 deletions distribution/ESCPos-0.1.1/reference/ESCPos/package-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Thu Sep 29 15:00:46 EDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Fri Mar 02 14:58:37 EST 2012 -->
<TITLE>
ESCPos (Javadocs: ESCPos)
</TITLE>

<META NAME="date" CONTENT="2011-09-29">
<META NAME="date" CONTENT="2012-03-02">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Thu Sep 29 15:00:46 EDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Fri Mar 02 14:58:37 EST 2012 -->
<TITLE>
ESCPos (Javadocs: ESCPos)
</TITLE>

<META NAME="date" CONTENT="2011-09-29">
<META NAME="date" CONTENT="2012-03-02">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions distribution/ESCPos-0.1.1/reference/ESCPos/package-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Thu Sep 29 15:00:46 EDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Fri Mar 02 14:58:37 EST 2012 -->
<TITLE>
ESCPos Class Hierarchy (Javadocs: ESCPos)
</TITLE>

<META NAME="date" CONTENT="2011-09-29">
<META NAME="date" CONTENT="2012-03-02">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions distribution/ESCPos-0.1.1/reference/allclasses-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Thu Sep 29 15:00:46 EDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Fri Mar 02 14:58:38 EST 2012 -->
<TITLE>
All Classes (Javadocs: ESCPos)
</TITLE>

<META NAME="date" CONTENT="2011-09-29">
<META NAME="date" CONTENT="2012-03-02">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions distribution/ESCPos-0.1.1/reference/allclasses-noframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Thu Sep 29 15:00:46 EDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Fri Mar 02 14:58:38 EST 2012 -->
<TITLE>
All Classes (Javadocs: ESCPos)
</TITLE>

<META NAME="date" CONTENT="2011-09-29">
<META NAME="date" CONTENT="2012-03-02">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions distribution/ESCPos-0.1.1/reference/constant-values.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Thu Sep 29 15:00:46 EDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Fri Mar 02 14:58:37 EST 2012 -->
<TITLE>
Constant Field Values (Javadocs: ESCPos)
</TITLE>

<META NAME="date" CONTENT="2011-09-29">
<META NAME="date" CONTENT="2012-03-02">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions distribution/ESCPos-0.1.1/reference/deprecated-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Thu Sep 29 15:00:46 EDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Fri Mar 02 14:58:38 EST 2012 -->
<TITLE>
Deprecated List (Javadocs: ESCPos)
</TITLE>

<META NAME="date" CONTENT="2011-09-29">
<META NAME="date" CONTENT="2012-03-02">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

Expand Down
4 changes: 2 additions & 2 deletions distribution/ESCPos-0.1.1/reference/help-doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Thu Sep 29 15:00:46 EDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Fri Mar 02 14:58:38 EST 2012 -->
<TITLE>
API Help (Javadocs: ESCPos)
</TITLE>

<META NAME="date" CONTENT="2011-09-29">
<META NAME="date" CONTENT="2012-03-02">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

Expand Down
22 changes: 15 additions & 7 deletions distribution/ESCPos-0.1.1/reference/index-all.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Thu Sep 29 15:00:46 EDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Fri Mar 02 14:58:37 EST 2012 -->
<TITLE>
Index (Javadocs: ESCPos)
</TITLE>

<META NAME="date" CONTENT="2011-09-29">
<META NAME="date" CONTENT="2012-03-02">

<LINK REL ="stylesheet" TYPE="text/css" HREF="./stylesheet.css" TITLE="Style">

Expand Down Expand Up @@ -76,16 +76,21 @@
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <A HREF="#_V_">V</A> <HR>
<A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <A HREF="#_V_">V</A> <HR>
<A NAME="_B_"><!-- --></A><H2>
<B>B</B></H2>
<DL>
<DT><A HREF="./ESCPos/ESCPos.html#beep()"><B>beep()</B></A> -
Method in class ESCPos.<A HREF="./ESCPos/ESCPos.html" title="class in ESCPos">ESCPos</A>
<DD>&nbsp;
</DL>
<HR>
<A NAME="_C_"><!-- --></A><H2>
<B>C</B></H2>
<DL>
<DT><A HREF="./ESCPos/ESCPos.html#cut()"><B>cut()</B></A> -
Method in class ESCPos.<A HREF="./ESCPos/ESCPos.html" title="class in ESCPos">ESCPos</A>
<DD>&nbsp;
<DT><A HREF="./ESCPos/ESCPos.html#cutAndFeed(int)"><B>cutAndFeed(int)</B></A> -
Method in class ESCPos.<A HREF="./ESCPos/ESCPos.html" title="class in ESCPos">ESCPos</A>
<DD>&nbsp;
</DL>
<HR>
<A NAME="_D_"><!-- --></A><H2>
Expand Down Expand Up @@ -116,6 +121,9 @@
<DT><A HREF="./ESCPos/ESCPos.html#feed(int)"><B>feed(int)</B></A> -
Method in class ESCPos.<A HREF="./ESCPos/ESCPos.html" title="class in ESCPos">ESCPos</A>
<DD>Prints n lines of blank paper.
<DT><A HREF="./ESCPos/ESCPos.html#feedAndCut(int)"><B>feedAndCut(int)</B></A> -
Method in class ESCPos.<A HREF="./ESCPos/ESCPos.html" title="class in ESCPos">ESCPos</A>
<DD>&nbsp;
</DL>
<HR>
<A NAME="_P_"><!-- --></A><H2>
Expand Down Expand Up @@ -200,7 +208,7 @@
<DD>return the version of the library.
</DL>
<HR>
<A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <A HREF="#_V_">V</A>
<A HREF="#_B_">B</A> <A HREF="#_C_">C</A> <A HREF="#_D_">D</A> <A HREF="#_E_">E</A> <A HREF="#_F_">F</A> <A HREF="#_P_">P</A> <A HREF="#_R_">R</A> <A HREF="#_S_">S</A> <A HREF="#_V_">V</A>

<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
Expand Down
2 changes: 1 addition & 1 deletion distribution/ESCPos-0.1.1/reference/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Sep 29 15:00:46 EDT 2011-->
<!-- Generated by javadoc on Fri Mar 02 14:58:38 EST 2012-->
<TITLE>
Javadocs: ESCPos
</TITLE>
Expand Down
4 changes: 2 additions & 2 deletions distribution/ESCPos-0.1.1/reference/overview-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_26) on Thu Sep 29 15:00:46 EDT 2011 -->
<!-- Generated by javadoc (build 1.6.0_29) on Fri Mar 02 14:58:37 EST 2012 -->
<TITLE>
Class Hierarchy (Javadocs: ESCPos)
</TITLE>

<META NAME="date" CONTENT="2011-09-29">
<META NAME="date" CONTENT="2012-03-02">

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

Expand Down
33 changes: 18 additions & 15 deletions src/library/ESCPos.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public ESCPos(PApplet p, Serial thisPort) {
}

private void welcome() {
System.out.println("\n##name## ##version## by ##author##\n");
System.out.println("\n##name## ##version## by ##author##!\n");
}

public void serialList(){
Expand Down Expand Up @@ -465,17 +465,11 @@ public void storeCustomChar(int[] columnArray, int mode){
printer.write(0x1B);
printer.write("*");
printer.write(mode);
printer.write(columnArray.length);//number of cols
printer.write( (mode==0 ||mode==1)? columnArray.length : columnArray.length / 3 );//number of cols
printer.write(0);

if(mode == 0 || mode == 1){
for (int i = 0 ; i < columnArray.length ; i++ ){
printer.write(columnArray[i]);
}
}else if(mode == 32 || mode ==32){
for (int i = 0 ; i < columnArray.length/3 ; i++ ){
printer.write(columnArray[i]);
}
for (int i = 0 ; i < columnArray.length ; i++ )
{
printer.write(columnArray[i]);
}

}
Expand Down Expand Up @@ -503,13 +497,22 @@ public void cut(){
printer.write(0);
}

public void cutAndFeed(int feed){
public void feedAndCut(int feed){

feed(feed);
printer.write(0x1D);
printer.write("V");
printer.write(66);
cut();
}

public void beep()
{
printer.write(0x1B);
printer.write("(A");
printer.write(4);
printer.write(0);
printer.write(48);
printer.write(55);
printer.write(3);
printer.write(15);
}


Expand Down

0 comments on commit 399961a

Please sign in to comment.