You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While writing a novel, I'd like to get feedback from alpha and beta readers. Currently, I build a PDF and send an email to each reader individually. A number of readers have requested the ability to send me feedback by adding annotations to the PDF directly. Ideally, without having to install any software on their laptop, desktop, or phone.
Workflow
In the following workflow diagram, the upper half is already accomplished using a shell script to upload and email a hyperlink to an alpha reader:
The lower half is the problem to be solved.
.htaccess
An .htaccess file can be used to invoke PHP to intercept and annotate the PDF before sending back to the browser:
SetEnv no-gzip dont-vary
<IfModule mod_rewrite.c>
RewriteEngine On
# Ensure the file exists before attempting to download it.
RewriteCond %{REQUEST_FILENAME} -f
# Inject annotations based on contents from filename.yaml.
RewriteRule ^([^/]+\.pdf)$ update.php?filename=$1 [L]
</IfModule>
This way of intercepting the PDF allows users to receive a simple hyperlink without seeing special query parameters.
JavaScript
On the client-side, pdf-lib can send annotation edits to the server, for example:
HTTP PUT https://hostname/alpha/filename.pdf?page=2&x=42&y=50&type=note&text="feedback"
Question
Is there a super-simple drop-in PHP solution that can allow users to edit PDF files and persist their changes stored server-side?
Additional requirements
Ideally, the server-side processing:
integrates with an existing web server (nginx or apache);
uses PHP for handling server-side requests;
has a zero authentication mode (links are always private);
does not use cloud or SaaS;
can integrate with .htaccess files (show above); and
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Background
While writing a novel, I'd like to get feedback from alpha and beta readers. Currently, I build a PDF and send an email to each reader individually. A number of readers have requested the ability to send me feedback by adding annotations to the PDF directly. Ideally, without having to install any software on their laptop, desktop, or phone.
Workflow
In the following workflow diagram, the upper half is already accomplished using a shell script to upload and email a hyperlink to an alpha reader:
The lower half is the problem to be solved.
.htaccess
An
.htaccess
file can be used to invoke PHP to intercept and annotate the PDF before sending back to the browser:This way of intercepting the PDF allows users to receive a simple hyperlink without seeing special query parameters.
JavaScript
On the client-side, pdf-lib can send annotation edits to the server, for example:
Question
Is there a super-simple drop-in PHP solution that can allow users to edit PDF files and persist their changes stored server-side?
Additional requirements
Ideally, the server-side processing:
.htaccess
files (show above); andBeta Was this translation helpful? Give feedback.
All reactions