# Why \pdfpageheight doesn't work

I am trying to convert my book pdf page size to 9'' x 6''. Here's my latex code

\documentclass[twoside]{book}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, amssymb, amsfonts}
\usepackage{amsthm}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\pdfpagewidth=6in
\pdfpageheight=9in
\textheight=6in
\textwidth=10.5cm
\hoffset=-2.25cm
\topmargin=0cm
\newtheorem{definition}{Definition}[section]
\newtheorem*{remark}{Remark}
\newtheorem*{problem}{Problem}
\newtheorem{example}{Example}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem*{s}{Statement}
\newtheorem*{corollary}{Corollary}
\begin{document}

\title{----------}
\author{-----------}
\frontmatter
\maketitle
\tableofcontents
\mainmatter
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\chapter{Preliminaries}

\bigskip
\bigskip
\bigskip

Hello!!

\end{document}


I used \pdfpagewidthbut that didn't work. Any help will be highly appreciated.

• Why aren't you using the geometry package like everyone else. It sets everything up correctly (latex does not use pdfpagewidth, it uses pagewidth, but pdfpagewidth needs to be set correctly into the pdf files, all something geometry handles for you) – daleif Aug 20 '19 at 17:28
• – John Kormylo Aug 20 '19 at 19:46
• Pleas clarify the meaing of “didn’t work”: exactly what goes wrong? Did you get error messages from the TeX compilers? Warnings? Or simply, he output is not what you expect? – GuM Aug 20 '19 at 22:51
• @GuM I meant that after running the program, the page size remained unchanged – Anand Aug 21 '19 at 6:15
• @daleif I am a beginner at latex, please tell me what should I replace in place of \pdfpagewidth and how to use geometry – Anand Aug 21 '19 at 6:16