I'm using geometry package like this:

\usepackage[landscape]{geometry}
\newgeometry{twocolumn, left=0.25cm, right=0.25cm, top=0.8cm, bottom=0.4cm}


and fancyhdr package like this:

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}


And everything with margins is ok. But when I'm printing pdf on paper all margins is changing. How can I fix page margins for printing?

All code looks like this:

\documentclass[8pt]{extarticle}

\usepackage[cp1251]{inputenc}

\usepackage[russian,english]{babel}

\usepackage[landscape]{geometry}

\usepackage{fancyhdr}

\pagestyle{fancy}

\fancyhf{}

\usepackage{listings}

\usepackage{color}

\definecolor{mygreen}{rgb}{0,0.6,0}

\definecolor{mygray}{rgb}{0.5,0.5,0.5}

\definecolor{myviolet}{rgb}{0.5,0,0.36}

\lstset{
backgroundcolor=\color{white},
language=C++,
keywordstyle=\color{myviolet},
frame=single,
framerule=0.1pt,
rulecolor=\color{black},
breakatwhitespace=true,
breaklines=true,
numbers=left,
stepnumber=1,
numbersep=5pt,
numberstyle=\tiny\color{mygray},
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2,
framexleftmargin=10pt,
framexrightmargin=-10pt,

}

\usepackage{amsmath}

\begin{document}

\selectlanguage{russian}

\newgeometry{twocolumn, left=0.7cm, right=0cm, top=0.8cm, bottom=0.4cm}

\begin{lstlisting}
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support.

This file is part of BFD, the Binary File Descriptor library.

This program is free software; you can redistribute it and/or modify
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA.  */

/* Which symbols to strip during a link.  */
{
strip_none,       /* Don't strip any symbols.  */
strip_debugger,   /* Strip debugging symbols.  */
strip_some,       /* keep_hash is the list of symbols to keep.  */
strip_all     /* Strip all symbols.  */
};

/* Which local symbols to discard during a link.  This is irrelevant
if strip_all is used.  */
{
sections.  */
};

/* Describes the type of hash table entry structure being used.
Different hash table structure have different fields and so
{
};

/* These are the possible types of an entry in the BFD link hash
table.  */

{
bfd_link_hash_new,        /* Symbol is new.  */
bfd_link_hash_undefined,  /* Symbol seen before, but undefined.  */
bfd_link_hash_undefweak,  /* Symbol is weak and undefined.  */
bfd_link_hash_defined,    /* Symbol is defined.  */
bfd_link_hash_defweak,    /* Symbol is weak and defined.  */
bfd_link_hash_common,     /* Symbol is common.  */
bfd_link_hash_warning     /* Like indirect, but warn if referenced.  */
};

{
};

{
unsigned int alignment_power;   /* Alignment.  */
asection *section;      /* Symbol section.  */
};

/* The linking routines use a hash table which uses this structure for
its elements.  */

{
/* Base hash table entry structure.  */
struct bfd_hash_entry root;

/* Type of this entry.  */

unsigned int non_ir_ref : 1;

/* A union of information depending upon the type.  */
union
{
/* Nothing is kept for bfd_hash_new.  */
struct
{
/* Undefined and common symbols are kept in a linked list through
this field.  This field is present in all of the union element
so that we don't need to remove entries from the list when we
change their type.  Removing entries would either require the
list to be doubly linked, which would waste more memory, or
require a traversal.  When an undefined or common symbol is
created, it should be added to this list, the head of which is in
the link hash table itself.  As symbols are defined, they need
not be removed from the list; anything which reads the list must
doublecheck the symbol type.

Weak symbols are not kept on this list.

Defined and defweak symbols use this field as a reference marker.
If the field is not NULL, or this structure is the tail of the

\end{lstlisting}

\end{document}


Command line for compiling:

latex a.tex dvipdfm a.dvi

-
Welcome to TeX.SE! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document} –  percusse Mar 3 '13 at 19:49
I've added MWE. –  Edvard Mar 3 '13 at 20:53

Possible reasons:

## Acrobat Reader/Shrink to printable area

Options for printing with Acrobat Reader are (naming can vary):

1. None
2. Fit to page area
3. Shrink to printable area

The default is (3) that means, the page is scaled down to fit the printable area if needed. Option (2) can also scale the page up. You need "None" to avoid scaling.

## Wrong paper size

Some TeX distributions can be configured for default paper sizes. But that does not change the default for the standard classes. Without paper size option, the standard classes uses letterpaper. Then the margins are not correct on an A4 paper, if they are set for letter size.

Remark: LaTeX and the standard classes do not tell the driver the correct paper size. The latter is done by packages such as geometry, hyperref, some pdftex.def (driver for graphics/color), … Without such a package and a paper size option, the result can be a PDF document with paper size A4 (TeX distribution/driver default), but at LaTeX level the page layout inclusive margins are configured for letter paper size.

Update: The used class is extarticle, its default is letter paper, thus option a4paper is needed:

\documentclass[a4paper,8pt]{extarticle}

-
I'll try first option. My code (I've added it in question) starts with \documentclass[8pt]{extarticle}. –  Edvard Mar 3 '13 at 21:08
I have tried None(Actual size) option but it don't help. –  Edvard Mar 4 '13 at 10:54
@Edvard You can edit your question to add a complete, but minimal example file, tell the used and wanted paper sizes, and which PDF viewer you are using. –  Heiko Oberdiek Mar 4 '13 at 11:09
I've added complete example. I am using A4 paper size. Of course I want to print in landscape mode. I'm using Adobe Reader X v 10.1.6 on Windows 7. –  Edvard Mar 4 '13 at 12:10
@Edvard Answer updated for class extartcle and A4 paper size. –  Heiko Oberdiek Mar 4 '13 at 15:38