title: How to store and retrieve a pdf file in couchdb using java
body: <p>How to store and retrieve a pdf file in couchdb using java.I have tried many links but they all only focus on storing and retrieving images but i am concerned about pdf files.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>// Create a BaseDocument
  BaseDocument doc = new BaseDocument();
  doc.setProperty("site", "www.onabai.com");
  doc.setProperty("leitmotif", "Working on a cloud of documents!");
  db.createDocument(doc);
  System.out.printf("Id: %s rev.: %s\n", doc.getId(), doc.getRevision());
  // Add attachment
  File file = new File("resources/jcouchdb.svg");
  InputStream is = new FileInputStream(file);
  String rev = db.createAttachment(doc.getId(), doc.getRevision(),
                                       "logo", "image/svg+xml", is, file.length());
  System.out.printf("New rev.: %s\n", rev);
  </code></pre>
  
  <p>I get an error saying method <code>createAttachment</code> doesn't exist.</p>