title: Golang convert pdf to image by bimg
body: <p>The example code below convert pdf to jpeg by using <a href="https://github.com/h2non/bimg#convert" rel="noreferrer">bimg</a>.</p>
  
  <pre><code>func main() {
  
      buffer, err := bimg.Read("test.pdf")
      if err != nil {
          fmt.Fprintln(os.Stderr, err)
      }
  
      newImage, err := bimg.NewImage(buffer).Convert(bimg.JPEG)
      if err != nil {
          fmt.Fprintln(os.Stderr, err)
      }
  
      if bimg.NewImage(newImage).Type() == "jpeg" {
          fmt.Fprintln(os.Stderr, "The image was converted into jpeg")
      }
  
      bimg.Write("test.jpg", newImage)
  
  }
  </code></pre>
  
  <p>But it only convert 1st page of <code>test.pdf</code>.</p>
  
  <p>Is there any way that convert to image that contain more than one page.</p>