Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error and zero window fix #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

EXEC=rastertotpcl
CFLAGS=-lcupsimage
LDLIBS=-lcupsimage -lm -lcups
PPDPATH=/usr/share/ppd
EXECPATH=/usr/lib/cups/filter

Expand Down
6 changes: 4 additions & 2 deletions src/rastertotpcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ StartPage(ppd_file_t *ppd, /* I - PPD file */
width = (int) (header->cupsPageSize[0] * 254/72);

/* Send label size, assume gap is same all the way round */
printf("{D%04d,%04d,%04d|}\n",labelpitch, width, length, width + labelgap);
printf("{D%04d,%04d,%04d|}\n",labelpitch, width, length);

/*
* Place the right command in the parameter AY temperature fine adjust
Expand Down Expand Up @@ -596,6 +596,8 @@ EndPage(ppd_file_t *ppd, /* I - PPD file */
/* Send eject command if cut active */
if (CutActive > 0)
printf("{IB|}\n");
// To avoid Zerowindow Error at the end of the stream
printf("%1024s","");

} // Not Cancelled

Expand Down Expand Up @@ -780,7 +782,7 @@ void TOPIXCompressOutputBuffer(ppd_file_t *ppd, /* PPD file */
/*
* Output the complete graphics line to STDOUT
*/
printf("{SG;0000,%04dD,%04d,%04d,%d,", CompLastLine, header->cupsBytesPerLine * 8, 300, Gmode);
printf("{SG;0000,%04d,%04d,%04d,%d,", CompLastLine, header->cupsBytesPerLine * 8, 300, Gmode);
fwrite(&belen, 2, 1, stdout); // Length of data
fwrite(CompBuffer, 1, len, stdout); // Data
printf("|}\n");
Expand Down