Fix errors in building PDF

Fix errors in building PDF.