code: func pageCountPoppler(filename string) (cnt int, err error) {
  	cmd := exec.Command("pdfinfo", filename)
  	out, err := cmd.CombinedOutput()
  	if err != nil {
  		return cnt, fmt.Errorf("could not get page count with pdfinfo: %v, %v", err, string(out))
  	}
  	sc := bufio.NewScanner(bytes.NewReader(out))
  	for sc.Scan() {
  		l := sc.Text()
  		if !strings.HasPrefix(l, "Pages: ") {
  			continue
  		}
  		return strconv.Atoi(strings.TrimSpace(strings.TrimPrefix(l, "Pages:")))
  	}
  	if err := sc.Err(); err != nil {
  		return 0, err
  	}
  	return 0, errors.New("page count not found in pdfinfo output")
  }
docs: // pageCountPoppler calls the tool pdfinfo from the Poppler project for
  // filename and parses the output for the page count which is then returned. If
  // any error occurs or the pages count information is not found, an error is
  // returned.