Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kam-printing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wizards
kam-printing
Commits
686a5568
Commit
686a5568
authored
8 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
We get dimensions in points, but send them in 100ths of mm
parent
7ccebad3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
xcpt.c
+15
-4
15 additions, 4 deletions
xcpt.c
with
15 additions
and
4 deletions
xcpt.c
+
15
−
4
View file @
686a5568
...
...
@@ -88,8 +88,8 @@ static char *xstrdup(const char *x)
O(INPUTTRAY, "automatic") \
O(TRAYFEED, "stack") \
O(MEDIATYPE, "system-default") \
O(MEDIAXSIZE, "
21000
") \
O(MEDIAYSIZE, "
29700
") \
O(MEDIAXSIZE, "
595
") \
O(MEDIAYSIZE, "
842
") \
O(FINISH_STAPLE, "") \
O(FINISH_PUNCH, "") \
O(FINISH_FOLD, "") \
...
...
@@ -307,6 +307,17 @@ static void xcpt_integer(const char *name, int value)
xcpt_printf
(
"<%s syntax=
\"
integer
\"
>%d</%s>"
,
name
,
value
,
name
);
}
static
void
xcpt_dimension
(
const
char
*
name
,
int
pt
)
{
/*
* We get dimensions in PostScript points (1/72 in).
* Xerox printers expect them in 100th's of mm, but
* last two digits must be 0.
*/
double
m
=
pt
*
(
25
.
4
/
72
.)
+
0
.
5
;
xcpt_integer
(
name
,
100
*
(
int
)
m
);
}
static
void
xcpt_keyword
(
const
char
*
name
,
const
char
*
value
)
{
xcpt_printf
(
"<%s syntax=
\"
keyword
\"
>%s</%s>"
,
name
,
value
,
name
);
...
...
@@ -456,8 +467,8 @@ static void gen_job_template(void)
xcpt_keyword
(
"tray-feed"
,
OPT
(
TRAYFEED
));
xcpt_keyword
(
"media-color"
,
OPT
(
MEDIACOLOR
));
xcpt_collection_open
(
"media-size"
);
xcpt_
integer
(
"x-dimension"
,
OPT_INT
(
MEDIAXSIZE
));
xcpt_
integer
(
"y-dimension"
,
OPT_INT
(
MEDIAYSIZE
));
xcpt_
dimension
(
"x-dimension"
,
OPT_INT
(
MEDIAXSIZE
));
xcpt_
dimension
(
"y-dimension"
,
OPT_INT
(
MEDIAYSIZE
));
xcpt_close
();
xcpt_keyword
(
"media-type"
,
OPT
(
MEDIATYPE
));
xcpt_close
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment