ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jaroslav Hajtmar <hajtmar@gyza.cz>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Different printing positions on cards
Date: Fri, 23 Jul 2010 06:04:59 +0200	[thread overview]
Message-ID: <4C4914EB.8070708@gyza.cz> (raw)

Hello all...
I am looking for problem in my example but without success.
As you can see in my minimal example, that any printing positions on any 
cards are diferent.
I want to print always started at the same place!
Someone knows a solution? Forgotten that any gaps?

Thanx Jaroslav


\newcount\countofhor\countofhor=3
\newcount\countofvert\countofvert=4
\newdimen\paperedge\paperedge=0.5cm
\newdimen\disthor\disthor=2mm
\newdimen\distvert\distvert=2mm

\newdimen\cardheight\newdimen\cardwidth
\newcount\countofcardsonpage\countofcardsonpage=\countofhor
\multiply\countofcardsonpage\countofvert

\definepapersize[BC][width=\cardwidth,height=\cardheight] % not change!


%\setuppapersize [BC][A4]
\setuppapersize [BC][A4,landscape]



% Calculate only:
\cardheight=\dimexpr((\printpaperheight-2\paperedge-\distvert*(\countofvert-1))/\countofvert)
\cardwidth=\dimexpr((\printpaperwidth-2\paperedge-\dimexpr(\disthor)*(\countofhor-1))/\countofhor)
\definemeasure[topspace] [\dimexpr(\printpaperheight-(\cardheight + 
\distvert)*\countofvert+\distvert)/2\relax]
\definemeasure[backspace] [\dimexpr(\printpaperwidth-(\cardwidth + 
\disthor)*\countofhor+\disthor)/2\relax]

\setuppaper     
[topspace=\measure{topspace},backspace=\measure{backspace},bottomspace=\measure{topspace},cutspace=\measure{backspace}, 
dx=\disthor,dy=\distvert,nx=\countofhor,ny=\countofvert]
\setuplayout    [page] 
[topspace=\measure{topspace},backspace=\measure{backspace},bottomspace=\measure{topspace},cutspace=\measure{backspace}]
\setuplayout    [location=middle, marking=on]
\setuparranging [XY]


\setuppagenumbering [alternative=doublesided,location=, state=stop]


\defineoverlay[pozadifront][{\externalfigure[file1.jpg][width=\cardwidth,height=\cardheight]}]
\defineoverlay[pozadiback][{\externalfigure[file2.jpg][width=\cardwidth,height=\cardheight]}]


\startbuffer[Front]
\leftaligned{\recurselevel\ - Front}%
\stopbuffer


\startbuffer[Back]
\leftaligned{\recurselevel\ - Back}%
\stopbuffer


\def\printactionpageone{%
\setupbackgrounds [page][background={pozadifront}]%
\getbuffer[Front]\page%
}%

\def\printactionpagetwo{%
\setupbackgrounds [page][background={pozadiback}]%
\getbuffer[Back]\page%
}%

\showframe[edge]

\starttext
\dorecurse{\countofcardsonpage}{\printactionpageone}
\dorecurse{\countofcardsonpage}{\printactionpagetwo}
\stoptext


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


             reply	other threads:[~2010-07-23  4:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-23  4:04 Jaroslav Hajtmar [this message]
2010-07-23  4:27 ` Jaroslav Hajtmar
2010-07-23  7:40 ` Hans Hagen
2010-07-23  8:09   ` Jaroslav Hajtmar
2010-07-23  8:24     ` Jaroslav Hajtmar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C4914EB.8070708@gyza.cz \
    --to=hajtmar@gyza.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).