# Page Numbering in Letter Environment has no desired effect with \usepackage{scrletter}

For a long application I have got the following problem: I cannot seem to make page numbering in the letter working.

My workflow is the following: I have got a main document with all preamble-information and

{scrartcl}
as documentclass; in the preamble I load
\usepackage{scrletter}
to have access to letter features of the koma-script letter features; the main document is below:

\documentclass[a4paper,%
fontsize=12pt,parskip=half*,%

\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[american,ngerman]{babel}
\usepackage[dvips,final]{graphicx}
\usepackage{scrletter}
\usepackage{microtype}
\usepackage{scrlayer-scrpage}
\usepackage{pifont}
\usepackage{charter}
\usepackage{pdfpages}
\usepackage{titlesec} % Used to customize the \section command
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule] % Text formatting of sections
\titlespacing{\section}{0pt}{3pt}{3pt} % Spacing around sections

\normalfont\small
}

\cfoot*{\thepage}

\areaset{155mm}{264mm}

\AtBeginDocument{\renewcaptionname{english}{\subjectname}{%
Application}
}

\renewcommand\raggedsignature{\raggedright}

\begin{document}

\include{title}

\tableofcontents

\include{letter}

\include{cv}

.
.
.

\end{document}


Then there are

title.tex, cv.tex, and letter.tex

Letter.tex looks like this:

\setkomavar*{enclseparator}{Enclosed}
\setkomavar{date}{\today}
\setkomavar{subject}{Application}

\let\letterpagemark\pagemark

\begin{letter}[]{University\\
Office of International Relations\\
Some Summer School 2017''\\
}

\pagestyle{letter}

blablablablabla blala blabla

\closing{Yours sincerely,}

\encl{Resume, Letter of Recommendation, Transcripts, Certificates, Print Copy of Online Registration form, blablabla}

\end{letter}


Even though page numbering works out of the box, even with the pdf-pages, I can not set the page number of the letter to 3. The page number is always set to 1 on the first letter. I tried to put

\setcounter{page}{3}
after
\opening
to no effect.

Thanks for any help in advance.

You need to save the page counter before the letter, and then restore it with \AtBeginLetter because KOMA-Script otherwise resets it when the letter starts. If you want the page number to print on the first page of the letter, you also need to provide a suitable \thispagestyle{} after the opening of the letter, because KOMA-Script at that point sets it to empty.

(Note that as esdd points out in a comment to the question, you could just set the value by hand -- but saving and restoring allow for changes in the earlier parts of the document.)

MWE follows. Note that there was a lot in your posted code that was unnecessary to the problem.

\documentclass{scrartcl}
\usepackage{blindtext}
\usepackage[T1]{fontenc}
\usepackage{scrletter}

\begin{document}

\blindtext

\clearpage

\newcounter{pagesaver}%to save the value
\setcounter{pagesaver}{\value{page}}%set it to the current value of page
\setkomavar*{enclseparator}{Enclosed}
\setkomavar{date}{\today}
\setkomavar{subject}{Application}
\AtBeginLetter{\setcounter{page}{\value{pagesaver}}}%restore value at start of letter

\begin{letter}[]{University\\
Office of International Relations\\
Some Summer School 2017\\
}

\thispagestyle{letter}

\Blindtext

\closing{Yours sincerely,}

\encl{Resume, Letter of Recommendation, Transcripts, Certificates, Print Copy of Online Registration form, blablabla}

\end{letter}

\blindtext

\end{document}