Skip to content

Paper saving (removal of page top/bottom margin) and some fixes#13

Open
gajdusek wants to merge 4 commits into
plinth666:masterfrom
Egston:feat/paper-reduction
Open

Paper saving (removal of page top/bottom margin) and some fixes#13
gajdusek wants to merge 4 commits into
plinth666:masterfrom
Egston:feat/paper-reduction

Conversation

@gajdusek
Copy link
Copy Markdown

Hello,

my use case requires the roll is being cut just after the output, rather than continue printing until end of configured paper height (e.g. 200mm). I called this feature "Margin Reduction". It's called Paper Reduction in official Epson drivers. My implementation just throws away blank rows on page top and/or bottom.

Additionally, I observed that CUPS web administration breaks in case a gzipped PPD file is present in /usr/share/cups/ (at least Debian 7 a 9 is affected). I modified makefile to not gzip PPD files.

I also unified formatting of C source as I had difficulties to work with mixed tabs/spaces indentation.

Let me know if I should break this in multiple pull requests.

Petr

Configurable by option "Margin Reduction" (MarginReductionType in PPD):

- None
- Top margin
- Bottom margin
- Top & Bottom margins (default)
- CUPS in Debian based distributions (including Raspbian) fails to load
  gzipped PPD files from /usr/share/cups/
  Note: gzipped PPD files in /usr/share/ppd/ work

- Compressing of PPD files saves very little disk space

- PPD files shipped by Debian seem to be not gzipped
@LukeAllen
Copy link
Copy Markdown

@plinth666 are you still maintaining this repo, or if not is there a fork that you recommend?

Comment thread src/bufferedscanlines.c
totalBytes = bs->bytesPerRow * bs->currentRow;
bs->currentRow = 0;
memset(bs->rawData, 0, totalBytes);
static void bufferscan_reset(t_bufferscan *bs) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of these changes are whitespace changes and don't add or fix anything in the existing code.
I don't know if this was intentional or not, but perhaps you'd like to limit your PR to material changes in the code base. Perhaps this was done by a pretty printing editor and you weren't aware? Consider excluding this file from the PR.

Comment thread src/bufferedscanlines.h
* abstraction takes away from the readability.
*/
typedef struct t_bufferscan {
int bytesPerRow;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Comment thread src/rastertoepsonsimple.c
struct command
{
int length;
struct command {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Comment thread src/rastertoepsonsimple.c

struct settings_
{
struct settings_ {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@doryza
Copy link
Copy Markdown

doryza commented May 10, 2019

Any chance of getting a PPD with the margin reduction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants