Could you use braces? I've found that relying on Javascript's implicit same-line or one-line `if` statements frequently leads to disaster when the code is edited in the future. Something like this would be great:
```js
if (pageNum > 1) {
  $("#previous").addClass("enabled");
} else {
  $("#previous").removeClass("enabled");
}
if (pageNum < pdfDocument.numPages) {
  $("#next").addClass("enabled");
} else {
  $("#next").removeClass("enabled");
}
```
As a bonus, it's more more readable. :)