Papermark: A DocSend Alternative for Data-Driven Document Sharing
Papermark is an open-source, DocSend alternative that gives you a professional way to share PDFs and other documents with built-in analytics and custom domains. From a software engineer's perspective, this is a powerful tool for a few key reasons. It allows you to track document engagement, which is incredibly useful for things like sharing a technical proposal, a project roadmap, or a portfolio with potential clients or employers. Instead of just sending a file and hoping for the best, you'll know exactly who viewed it, when they viewed it, and how much time they spent on each page. This data is invaluable for understanding if your document is resonating with your audience and can help you iterate and improve your materials.
Furthermore, being open-source means you have full control. You can host it on your own infrastructure, customize it to fit your specific needs, and integrate it directly into your existing applications or workflows. For example, if you're building a SaaS product, you could use Papermark to handle all your internal documentation, user guides, or marketing materials, all while keeping the data within your own ecosystem.
Getting Papermark up and running is pretty straightforward. The project is built with TypeScript and is designed to be self-hosted. The simplest way to get started is by using Docker Compose.
Clone the repository
First, you'll need to clone the official Papermark repository from GitHub.
git clone https://github.com/mfts/papermark.git
cd papermark
Set up the environment
You'll need to create a .env file to configure your settings. The repository includes an example file (.env.example) that you can use as a template. You'll need to configure things like your database connection string and any necessary API keys.
cp .env.example .env
# Now, edit the .env file with your specific configurations
Run with Docker Compose
Once your environment is configured, you can use Docker Compose to spin up all the necessary services, including the application, database, and any other dependencies.
docker-compose up -d
After running this command, Papermark will be running locally, and you can access the dashboard to begin uploading and sharing documents.
While Papermark's core functionality is a standalone application, a software engineer's real advantage comes from its integration potential. Here’s a hypothetical example of how you might integrate Papermark's document sharing into a web application using a simple Node.js and Express server.
Let's say you want to automatically create a unique, tracked link for a new user's welcome guide PDF when they sign up. You could use an API or a CLI tool to interact with your Papermark instance.
// This is a conceptual example. The actual API may vary.
const express = require('express');
const axios = require('axios'); // For making HTTP requests to the Papermark API
const app = express();
const PAPERYMARK_API_URL = 'http://localhost:3000/api/documents'; // Replace with your Papermark instance URL
// Assuming you have a function that creates a tracked link
async function createTrackedDocumentLink(documentPath, documentTitle) {
try {
const response = await axios.post(PAPERYMARK_API_URL, {
filePath: documentPath, // Path to your PDF on the server
title: documentTitle,
// You can add more options like custom analytics tags
});
// The API response would contain the unique link and other details
return response.data.trackedLink;
} catch (error) {
console.error('Error creating tracked link:', error);
return null;
}
}
// A simple API endpoint to get a tracked link for a welcome guide
app.get('/api/welcome-guide-link', async (req, res) => {
const welcomeGuidePath = '/path/to/your/welcome-guide.pdf';
const link = await createTrackedDocumentLink(welcomeGuidePath, 'Welcome Guide for New Users');
if (link) {
res.json({ trackedLink: link });
} else {
res.status(500).send('Failed to generate tracked link.');
}
});
app.listen(8080, () => {
console.log('Server is running on port 8080');
});