GithubHelp home page GithubHelp logo

strukturag / pdfdraw Goto Github PK

View Code? Open in Web Editor NEW
43.0 43.0 10.0 3.25 MB

Nextcloud app to annotate PDF documents

License: GNU Affero General Public License v3.0

Makefile 1.39% PHP 34.19% SCSS 0.23% CSS 3.38% JavaScript 55.38% Python 5.29% Dockerfile 0.14%
app javascript nextcloud node pdf socket-io socketio

pdfdraw's People

Contributors

dependabot[bot] avatar elvirusde avatar fancycode avatar mueller-werner avatar onkarruikar avatar szaimen avatar transifex-integration[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pdfdraw's Issues

Download error when using GROUP FOLDERS

server.js log:

pdftk returned an error when merging Error: Unable to find file.
Error: Failed to open PDF file: 
   -
Errors encountered.  No output created.
Done.  Input errors, so no output created.

Apache log:

###.###.###.### - - [05/Apr/2021:13:23:59 -0400] "GET /apps/pdfdraw/download/1928335 HTTP/1.1" 404 192 "-" "-"

This could be solved trivially by using webdav for file operations, which may go along well with #6

[ Deprecation notice ] deprecated [email protected]

Hi,

I'm working on a Helm chart to deploy the PDF Annotations server on a Kubernetes cluster (to complement the NextCloud app), and along the way I stumbled over this deprecation message:

npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)

My question is: would it be safe to upgrade to a newer version of this library? If so what version should I try to use?

Thanks

Some fixes

I'm not making a pull request because it isn't ready for that just yet, but I figured that the changes I've made would probably be useful for someone.

lbdroid@76e7eb0

This implements save-in-place, fixes the problem with nextcloud responding with error 404, and partially fixes work within group folders (create a user named "testuser" and grant access to the group data for now).

When you hit the save button, it saves in place, it does NOT download -- currently sticks you with an error, but that's related to the download not the save.

Trouble installing PDF Annotate backend Server

Hello Guys.

Im having trouble installing the Server Backend component.
In your README you are suggesting: "Copy server.conf.in to server.conf and adjust to your requirements."

I can not copy your example file, because it does not exist in the default folder.... ?

Am i missing something?

Thanks in advance for your help!

Nextcloud App PDF-Annotation: After execute "node server.js": TypeError: socketio is not a function

Dear Team,

I installed pdfdraw as an app in Nextcloud (V20.04). When starting the server with node server.js the error: TypeError: socketio is not a function occurred.
In Nexcloud the Annotation context menu is displayed and the pdf is also loaded with the annotation tools. But the message "Establishing connection, please wait ..." remains and the file cannot be saved. This is likely due to the error displayed?

Here are the configuration data for my installation:
I currently have the following programs installed in addition to the app:

  • node 14.5.3
  • npm 6.14.9
  • svglib
  • Python

With "node ini" the required package.json was created in the Nextcloud directory "apps / pdfdraw / server":

{
  "name": "server",
  "version": "1.0.0",
  "description": "pdf_annotation",
  "main": "server.js",
  "dependencies": {
    "jsonwebtoken": "^ 8.5.1",
    "socket.io": "^ 3.0.4"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \" Error: no test specified \ "&& exit 1",
    "start": "node server.js"
  },
  "author": "",
  "license": "ISC",
  "keywords": [
    "nextcloud"
  ]
}

I adjusted the config.js as follows:

var config = {};
// The port the service should run on.
config.port = 8080;
// The shared secret for token validation. Must be the same value
// as configured in the Nextcloud admin interface.
config.secret = 'Placeholder for real share token in Nextcloud';
// INSECURE! Allow any self-signed / expired certificates.
// Only use this during development!
config.allow_invalid_certificates = false;
// Required for newer versions of node / libssl.
// See https://github.com/nodejs/node/issues/21513#issuecomment-399790415
config.use_auto_ecdh_curve = false;
// Command to use when running pdftk. Defaults to 'pdftk' if not configured.
config.cmd_pdftk = 'pdftk';
// Command to use when running svg2pdf. Defaults to 'svg2pdf' if not configured.
config.cmd_svg2pdf = 'svg2pdf';
module.exports = config;

Is there a configuration error there? Here is the complete output after execute "node server.js":

user1 @ h3848484: / var / www / nextcloud / apps / pdfdraw / server # node server.js
Using pdftk to run as pdftk
Using svg2pdf to run as svg2pdf
/var/www/nextcloud/apps/pdfdraw/server/server.js:858
io.set ('origins', '*: *');
   ^
TypeError: io.set is not a function
    at Object. <anonymous> (/var/www/nextcloud/apps/pdfdraw/server/server.js:858:4)
    at Module._compile (internal / modules / cjs / loader.js: 1063: 30)
    at Object.Module._extensions..js (internal / modules / cjs / loader.js: 1092: 10)
    at Module.load (internal / modules / cjs / loader.js: 928: 32)
    at Function.Module._load (internal / modules / cjs / loader.js: 769: 14)
    at Function.executeUserEntryPoint [as runMain] (internal / modules / run_main.js: 72: 12)
    at internal / main / run_main_module.js: 17:47

best greetings

Cannot install plugin

Error shown:

The appinfo/database.xml file is not longer supported. Used in pdfdraw.

after clicking download and enable.

Connection is interrupted. restablishing connection

Nextcloud 21.0
PDF Annotation 1.2.0 downloaded from Nextcloud market

Hi,
I know that Nextcloud 21.0 is not supported by PDF Annotation 1.2.0 but, is there any fix for the following error? In the client browser I can see this messages:
DevTools failed to load source map: Could not parse content for http://nextcloudpre.mydomain.org/custom_apps/pdfdraw/js/libs/socket.io.js.map: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
DevTools failed to load source map: Could not parse content for http://nextcloudpre.mydomain.org/custom_apps/pdfdraw/js/libs/iro.min.js.map: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
DevTools failed to load source map: Could not parse content for http://nextcloudpre.mydomain.org/custom_apps/pdfdraw/js/libs/iro-transparency-plugin.min.js.map: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
144util.js:133 OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment

Thanks!!

Doesn't install in NextCloud 25

I'm getting the following error when installing this app in NextCloud 25.

The appinfo/database.xml file is not longer supported. Used in pdfdraw

Using with local nextcloud setup

Hi, looking for some help.
Trying to get it to work with a local nextcloud instance (localhost) seems not to work. I'm not sure whether nextcloud has to be served via SSL or requires an extra domain but I could not get it to save my annotation because the communication from the pdfdraw-server to the nextcloud api failed.

nextcloud: localhost:8080
pdfdraw-server: localhost:8081

My docker-compose.yml

Nexcloud app configuration:
-> secret: test-key
-> host: http://localhost:8081

version: '2'

volumes:
nextcloud-files:
mysql-files:

services:
db:
  container_name: nextcloud-db
  image: mariadb
  restart: always
  command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
  volumes:
    - mysql-files:/var/lib/mysql
  environment:
    - MYSQL_ROOT_PASSWORD=admin
    - MYSQL_PASSWORD=nextcloud
    - MYSQL_DATABASE=nextcloud
    - MYSQL_USER=nextcloud

# redis:
#   container_name: nextcloud-redis
#   image: redis:alpine
#   restart: always

app:
  container_name: nextcloud-app
  image: nextcloud:19
  #image: nextcloud:20-rc
  restart: always
  ports:
    - 8080:80
  links:
    - db
    # - redis
    # - pdfdraw-server
  volumes:
    - nextcloud-files:/var/www/html
  environment:
    - MYSQL_PASSWORD=nextcloud
    - MYSQL_DATABASE=nextcloud
    - MYSQL_USER=nextcloud
    - MYSQL_HOST=db
    # - REDIS_HOST=redis
    - NEXTCLOUD_ADMIN_USER=nextcloud
    - NEXTCLOUD_ADMIN_PASSWORD=nextcloud

pdfdraw-server:
  container_name: nextcloud-pdfdraw-backend
  build:
    context: pdfdraw/server
    dockerfile: docker/Dockerfile
  #links:
  #  - app
  environment:
    port: 8081
    secret: 'test-key'
    #allow_invalid_certificates: 1
    #use_auto_ecdh_curve: 1
    #cmd_pdftk: ''
    #cmd_svg2pdf: ''
    #network_mode: "host"

  ports:  
  - '8081:8081'
My errors
nextcloud-pdfdraw-backend | a user connected {
nextcloud-pdfdraw-backend |   token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sb2NhbGhvc3Q6ODA4MCIsI
nN1YiI6Im5leHRjbG91ZCIsImV4cCI6MTYxNDA3OTE1NCwiZmlsZSI6IjE0MiIsImZpbGVuYW1lIjoiNDBhY2ZkNDMzYzliNmRhOTVjODk3MWY4NDFmZDVmN
zZkYjEyZTFhYS0xNjExMzA1Njk5OTAzLnBkZiIsImRpc3BsYXluYW1lIjoibmV4dGNsb3VkIiwicGVybWlzc2lvbnMiOjI3fQ.G8v6oehCCoPcPcNGx4CYH5
GObyhhf__3kEQJ146flM0',
nextcloud-pdfdraw-backend |   EIO: '3',
nextcloud-pdfdraw-backend |   transport: 'websocket'
nextcloud-pdfdraw-backend | }
nextcloud-pdfdraw-backend | Token {
nextcloud-pdfdraw-backend |   iss: 'http://localhost:8080',
nextcloud-pdfdraw-backend |   sub: 'nextcloud',
nextcloud-pdfdraw-backend |   exp: 1614079154,
nextcloud-pdfdraw-backend |   file: '142',
nextcloud-pdfdraw-backend |   filename: '40acfd433c9b6da95c8971f841fd5f76db12e1aa-1611305699903.pdf',
nextcloud-pdfdraw-backend |   displayname: 'nextcloud',
nextcloud-pdfdraw-backend |   permissions: 27
nextcloud-pdfdraw-backend | }
nextcloud-pdfdraw-backend | created room 142
nextcloud-pdfdraw-backend | user joined room 142 {
nextcloud-pdfdraw-backend |   displayname: 'nextcloud',
nextcloud-pdfdraw-backend |   permissions: 27,
nextcloud-pdfdraw-backend |   userid: 'BxUcYBinabe18qE3AAAB'
nextcloud-pdfdraw-backend | }
nextcloud-pdfdraw-backend | Error receiving items {
nextcloud-pdfdraw-backend |   error: Error: connect ECONNREFUSED 127.0.0.1:8080
nextcloud-pdfdraw-backend |       at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1137:16) {
nextcloud-pdfdraw-backend |     errno: -111,
nextcloud-pdfdraw-backend |     code: 'ECONNREFUSED',
nextcloud-pdfdraw-backend |     syscall: 'connect',
nextcloud-pdfdraw-backend |     address: '127.0.0.1',
nextcloud-pdfdraw-backend |     port: 8080
nextcloud-pdfdraw-backend |   }
nextcloud-pdfdraw-backend | }

And errors while annotation/drawing (probably because of the error above):

nextcloud-pdfdraw-backend | Error receiving items {
nextcloud-pdfdraw-backend |   error: Error: write EPROTO 140583453284224:error:1408F10B:SSL routines:ssl3_get_record:wro
ng version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
nextcloud-pdfdraw-backend |
nextcloud-pdfdraw-backend |       at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
 {
nextcloud-pdfdraw-backend |     errno: -71,
nextcloud-pdfdraw-backend |     code: 'EPROTO',
nextcloud-pdfdraw-backend |     syscall: 'write'
nextcloud-pdfdraw-backend |   }
nextcloud-pdfdraw-backend | }

I also tried splitting the nextcloud and the pdfdraw server into separate configurations but that failed more because then the localhost domain was not the same in the pdfdraw instance compared to the nextcloud one ...
For this I "fixed" the pdfdraw server code to use host.docker.internal instead of localhost for the separate docker-compose configs but this did not work/same error.

So, the socket.io communication works but all requests back to nextcloud fail.
Does it require some extra nginx configuration? Described in #16 ? But I'm not sure how exactly, as the nextcloud server is also on localhost and doesn't use SSL.

Update: same issue/error when I run the pdfdraw server locally (not in docker).
I then need to update the URL to use the docker host ip (some stackoverflow answer) to get the correct address:

export DOCKERHOST=$(ifconfig | grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d: | head -n1)
echo $DOCKERHOST

Changing config.allow_invalid_certificates and config.use_auto_ecdh_curve did not help.

Not Found The requested URL was not found on this server.

Not Found
The requested URL was not found on this server.

The Server is runing
`[root@cloud server]# node server.js
Using pdftk to run as pdftk
Using svg2pdf to run as svg2pdf
listening on *:8888

`
the Backend server is set
//192.168.1.135:8888/

"Connecting to server please wait"

Hello there I have installed pdfdraw using docker, and I was trying to use it. Now after I started the container and opened one pdf file with "annotate" option, it says "connecting to server please wait" and do nothing. Here is the log...

{"reqId":"YHa7hmOPGXBL5rLfsUohFwAABAw","level":3,"time":"2021-04-14T09:53:10+00:00","remoteAddr":"192.168.15.17","user":"Amanuel Kumera","app":"PHP","method":"GET","url":"/apps/pdfdraw/viewer/5649?file=https://nextacso.com/apps/pdfdraw/d/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvbmV4dGFjc28uY29tIiwic3ViIjoiQW1hbnVlbCBLdW1lcmEiLCJleHAiOjE2MTgzOTQyOTAsImZpbGVJZCI6IjU2NDkiLCJ0b2tlbiI6bnVsbH0.EAoLuLOQX5_y5hjgVVFKuTDZaKYzkO_RDTa_8b5SEW4","message":{"Exception":"Error","Message":"Undefined index: scheme at /var/www/html/nextcloud/apps/pdfdraw/lib/Controller/ViewerController.php#398","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/apps/pdfdraw/lib/Controller/ViewerController.php","line":398,"function":"onError","class":"OC\Log\ErrorHandler","type":"::"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":218,"function":"viewer","class":"OCA\Pdfdraw\Controller\ViewerController","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":127,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/var/www/html/nextcloud/lib/base.php","line":993,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"/var/www/html/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36 Edg/89.0.774.76","version":"21.0.1.1","id":"6076d6b165f09"}

Any updates?

This really was the only program that allowed PDF edits in nextcloud. Any updates coming to allow this to work?

Reimplement server in php and/or eliminate backend

It would be much preferred to have the backend implemented in PHP, since that would permit the webserver to handle the backend directly instead of proxying it to an unnecessary additional server. There isn't anything in server.js that wouldn't be easy to rewrite in php.

In addition, having it rewritten in php may allow the backend to be eliminated altogether -- just fold it into the frontend.

issue: OCP\\App\" not found"

installed and setup pdfdraw but i get the following error. Anyone an idea?

{"reqId":"1sHObaAs2cxQHHAL2z7M","level":3,"time":"2022-11-16T18:55:27+01:00","remoteAddr":"XXXXXXXX","user":"XXXXXXX","app":"index","method":"GET","url":"/apps/pdfdraw/viewer/285?file=https://XXXXXXXXX/apps/pdfdraw/d/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2Nsb3VkLmFkd29yay5kZSIsInN1YiI6IndlYmFkbWluIiwiZXhwIjoxNjY4NjIxNjI3LCJmaWxlSWQiOiIyODUiLCJ0b2tlbiI6bnVsbH0.eKyVsrTFfJAXp_LDLlxY6i-95NHsv8EMYoYL26h4_Ho","message":"Class \"OCP\\App\" not found","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36","version":"25.0.1.1","exception":{"Exception":"Error","Message":"Class \"OCP\\App\" not found","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":180,"function":"include"},{"file":"/var/www/nextcloud/lib/private/Template/Base.php","line":150,"function":"load","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Template.php","line":181,"function":"fetchPage","class":"OC\\Template\\Base","type":"->"},{"file":"/var/www/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php","line":213,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":178,"function":"render","class":"OCP\\AppFramework\\Http\\TemplateResponse","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1047,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/pdfdraw/templates/viewer.php","Line":5,"CustomMessage":"--"}}

Annotate jpg images as well and notification about annotations

Current version installs well, there was little trouble with apache reverse proxy, just made typo, but tcpdump inside container helped.

I propose to expand the same concept into jpg files as well,

I propose an automated comment/another remark to file if someone has annotated the file, may be a tag after the annotation. May be I am blind too, I have just installed the app.

No need to overwrite an existing .pdf, it is not wise idea to destroy originals, but save as in adittion to download would be helpful - allows to share links for example.

Setup like described - but "Establishing connection, please wait.."

Setup with nginx / proxy_pass as described.
Websocket log:

down: 0{"sid":"dUPskU726Iye118fAAAB","upgrades":[],"pingInterval":25000,"pingTimeout":5000}
up: 40/socket.io?token=xxxx
down: 42["user.joined",[{"displayname":"nadmin","permissions":27,"userid":"xxx"}]]
down: 44/socket.io,"Invalid namespace"

no idea if "Invalid namespace" causes the problems?

Cannot find module 'jsonwebtoken'

After installing all dependencies as described, I get this at service start in syslog:

Jan 25 13:34:20 cloud systemd[1]: Started PDF Annotation service for Nextcloud.
Jan 25 13:34:20 cloud nodejs[16951]: internal/modules/cjs/loader.js:638
Jan 25 13:34:20 cloud nodejs[16951]:     throw err;
Jan 25 13:34:20 cloud nodejs[16951]:     ^
Jan 25 13:34:20 cloud nodejs[16951]: Error: Cannot find module 'jsonwebtoken'
Jan 25 13:34:20 cloud nodejs[16951]:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
Jan 25 13:34:20 cloud nodejs[16951]:     at Function.Module._load (internal/modules/cjs/loader.js:562:25)
Jan 25 13:34:20 cloud nodejs[16951]:     at Module.require (internal/modules/cjs/loader.js:692:17)
Jan 25 13:34:20 cloud nodejs[16951]:     at require (internal/modules/cjs/helpers.js:25:18)
Jan 25 13:34:20 cloud nodejs[16951]:     at Object.<anonymous> (/var/www/nextcloud/apps/pdfdraw/server/server.js:46:11)
Jan 25 13:34:20 cloud nodejs[16951]:     at Module._compile (internal/modules/cjs/loader.js:778:30)
Jan 25 13:34:20 cloud nodejs[16951]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
Jan 25 13:34:20 cloud nodejs[16951]:     at Module.load (internal/modules/cjs/loader.js:653:32)
Jan 25 13:34:20 cloud nodejs[16951]:     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
Jan 25 13:34:20 cloud nodejs[16951]:     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
Jan 25 13:34:20 cloud systemd[1]: pdfdraw.service: Main process exited, code=exited, status=1/FAILURE
Jan 25 13:34:20 cloud systemd[1]: pdfdraw.service: Failed with result 'exit-code'.

This is on a Ubuntu 20.04 server.

Fundamentally bad design

I've decided that this project is basically abandoned, and I'm starting to work on a (currently private) fork.

The initial objective will be to eliminate the unnecessary backend server, which is actually pretty easy. I've already got the whole input side of it working without any kind of backend connection at all, and dumping what data would be sent to the backend out to the javascript console. This annotation data will be stored locally (client's browser) until they decide to do something with it -- mainly to save an annotated PDF to nextcloud. I don't see a particular urgency to store annotations in the database for later, but it could be addressed.

A bunch of this program revolves around the notion of real-time multi-user annotations. I do NOT see this as an important feature at all, and I'm sure most others would agree, so I'm not going to waste any time with that kind of nonsense, however, I will document my thoughts on implementing such a feature should anyone wish to do so; in particular, rather than saving the changes through the backend/websocket, feed it to nextcloud using XHR and using the notification subsystem to trigger data retrievals on other clients.

Once I've got the basic functionality working again without the backend, I'll work on adding text and customizable stamps.

[webpack-cli] HookWebpackError: Not supported

`make
npm install
npm WARN [email protected] requires a peer of worker-loader@^3.0.7 but none is installed. You must install peer dependencies yourself.

audited 366 packages in 2.198s

51 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

npm run build

[email protected] build /var/www/html/seacloud/apps/pdfdraw
NODE_ENV=production webpack --progress --config webpack.js

[webpack-cli] HookWebpackError: Not supported
at makeWebpackError (/var/www/html/seacloud/apps/pdfdraw/node_modules/webpack/lib/HookWebpackError.js:48:9)
at hooks.processAssets.callAsync.err (/var/www/html/seacloud/apps/pdfdraw/node_modules/webpack/lib/Compilation.js:3055:12)
at eval (eval at create (/var/www/html/seacloud/apps/pdfdraw/node_modules/tapable/lib/HookCodeFactory.js:33:10), :51:1)
at err (/var/www/html/seacloud/apps/pdfdraw/node_modules/webpack/lib/Compilation.js:508:26)
at compilation.hooks.processAssets.tapAsync (/var/www/html/seacloud/apps/pdfdraw/node_modules/copy-webpack-plugin/dist/index.js:485:13)
at process._tickCallback (internal/process/next_tick.js:68:7)
-- inner error --
Error: Not supported
at compilation.hooks.processAssets.tapAsync (/var/www/html/seacloud/apps/pdfdraw/node_modules/copy-webpack-plugin/dist/index.js:481:13)
at fn (/var/www/html/seacloud/apps/pdfdraw/node_modules/webpack/lib/Compilation.js:507:9)
at Hook.eval [as callAsync] (eval at create (/var/www/html/seacloud/apps/pdfdraw/node_modules/tapable/lib/HookCodeFactory.js:33:10), :48:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/var/www/html/seacloud/apps/pdfdraw/node_modules/tapable/lib/Hook.js:18:14)
at cont (/var/www/html/seacloud/apps/pdfdraw/node_modules/webpack/lib/Compilation.js:3052:34)
at createChunkAssets.err (/var/www/html/seacloud/apps/pdfdraw/node_modules/webpack/lib/Compilation.js:3100:10)
at symbolIterator (/var/www/html/seacloud/apps/pdfdraw/node_modules/neo-async/async.js:3485:9)
at timesSync (/var/www/html/seacloud/apps/pdfdraw/node_modules/neo-async/async.js:2297:7)
at Object.eachLimit (/var/www/html/seacloud/apps/pdfdraw/node_modules/neo-async/async.js:3463:5)
at Compilation.createChunkAssets (/var/www/html/seacloud/apps/pdfdraw/node_modules/webpack/lib/Compilation.js:4452:12)
caused by plugins in Compilation.hooks.processAssets
Error: Not supported
at compilation.hooks.processAssets.tapAsync (/var/www/html/seacloud/apps/pdfdraw/node_modules/copy-webpack-plugin/dist/index.js:481:13)
at fn (/var/www/html/seacloud/apps/pdfdraw/node_modules/webpack/lib/Compilation.js:507:9)
at Hook.eval [as callAsync] (eval at create (/var/www/html/seacloud/apps/pdfdraw/node_modules/tapable/lib/HookCodeFactory.js:33:10), :48:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/var/www/html/seacloud/apps/pdfdraw/node_modules/tapable/lib/Hook.js:18:14)
at cont (/var/www/html/seacloud/apps/pdfdraw/node_modules/webpack/lib/Compilation.js:3052:34)
at createChunkAssets.err (/var/www/html/seacloud/apps/pdfdraw/node_modules/webpack/lib/Compilation.js:3100:10)
at symbolIterator (/var/www/html/seacloud/apps/pdfdraw/node_modules/neo-async/async.js:3485:9)
at timesSync (/var/www/html/seacloud/apps/pdfdraw/node_modules/neo-async/async.js:2297:7)
at Object.eachLimit (/var/www/html/seacloud/apps/pdfdraw/node_modules/neo-async/async.js:3463:5)
at Compilation.createChunkAssets (/var/www/html/seacloud/apps/pdfdraw/node_modules/webpack/lib/Compilation.js:4452:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: NODE_ENV=production webpack --progress --config webpack.js
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-12-10T12_46_34_068Z-debug.log
make: *** [Makefile:48:build] error 2
`

Download from server not possible

Hi,

it is probably only a configuration problem, but I could not solve it...

I use the server as docker image with apache as reverse proxy. I manage to get the websocket part working, so the app connects to the server and what was drawn is saved correctly.

But as soon as I try to download the pdf, it will not work and I get the following error in the Chrome developer logging:
POST https://pdfdraw.criby.de/download/2311955 500

This is my apache proxy configuration:

ProxyRequests off

ProxyPass               "/socket.io" "ws://localhost:8082/socket.io" retry=3
ProxyPassReverse        "/socket.io" "ws://localhost:8082/socket.io" retry=3
ProxyPass               "/download/" "http://localhost:8082/download/"
ProxyPassReverse        "/download/" "http://localhost:8082/download/"

RequestHeader set X-Forwarded-Proto "https"

Can anybody give me a hint what is wrong in my configuration?

Thank you very much in advance!

Best regards,
Christoph

Annotation tools?

It appears that the only thing that can be done is to draw or delete squiggles, lines, boxes, and ovals?

To make this properly useful, it is necessary to be able to create TEXT annotations, and user-defined STAMPS (i.e., transparent PNG images that can be stamped onto the PDF where needed).

Is the pointer tool supposed to actually do anything? Seems to be just a colored dot and username that moves around the screen, but nothing happens when mouse is clicked.

PHP 8 Support

Related to #21 PHP 8 support was introduced. 7.x will continue to be supported for the time being.

Please support Nextcloud's external storage

Hi, I am using local external storage inside Nextcloud and there it always says PDF generation failed, please try again later. when trying to download the annotated file. When using "normal" nextcloud storage, it works though.
(the same seems to apply to groupfolders but this isn't important to me)
Thanks!

README.md can be improved

This sounds like a really interesting app! This addresses an important need. So thanks for working on this!

I have a lot of questions, and I did not find enough information about it in the README.md file (or anywhere else).

Questions are:

  1. Where is the annotation information stored? In the NC database? In a separate file? In the PDF itself?
  2. Related to that, what permissions are required? Does the PDF file need to be writable? Does the folder need write permission? (I am asking because I have a significant number of PDFs on an externally mounted folder, which does not give users write permit.)
  3. Also related to the first question: what happens if the PDF file gets moved or renamed (or deleted, for that matter)?
  4. Where can I find more details about the required node.js installation?

Thanks for your support?

Blocked by security settings

Hello!
Your app looks great!
We tried to get it to run with our nextcloud that runs in a docker-container.

When trying to open a pdf we get the follwoing error in the developer's console.
Content Security Policy: The page’s settings blocked the loading of a resource at http://cloud.MYDOMAIN.de/apps/pdfdraw/viewer/4506?file=http://cloud.MYDOMAIN.de/index.php/apps/pdfdraw/d/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9jbG91ZC5ob2ZhbGFiLmRlIiwic3ViIjoiQW5kcmUiLCJleHAiOjE2MTI2NTYyODksImZpbGVJZCI6IjQ1MDYiLCJ0b2tlbiI6bnVsbH0.3UPIT61ju0xIU7iqZgR732zatNS9ZwHqDSK5j0qkd8Y (“frame-src”).

however - even removing all security header did not change this situation.
Did you make similar experiences?

Stuck at "Establishing connection, please wait..."

I did a fresh install of Ubuntu 20.04.1 with a LEMP-stack and installed Nextcloud 20.0.5 the classic way (so far everything works fine).

I cloned the pdfdraw-repo including subs into the nextcloud-apps-folder, installed all requirements for the backend-server, configurated it (in files&admin) and started the backend-server.

#: sudo /usr/bin/nodejs server.js
WARNING: Invalid certificates are allowed!
Using pdftk to run as pdftk
Using svg2pdf to run as svg2pdf
listening on *:8080

If i open a PDF to Annotate, the PDF is loaded and displayed correctly (the annotation-tools are visible), but there's also a message overlay: Establishing connection, please wait... , that won't vanish...

In the same time server.js prints:

a user connected { token:
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvbmV4dGNsb3VkLnZhbGVuY2lhLmNoIiwic3ViIjoibmNhZG1pbiIsImV4cCI6MTYxMTI0Mjc4MCwiZmlsZSI6IjciLCJmaWxlbmFtZSI6IlJlYXNvbnMgdG8gdXNlIE5leHRjbG91ZC5wZGYiLCJkaXNwbGF5bmFtZSI6Im5jYWRtaW4iLCJwZXJtaXNzaW9ucyI6Mjd9.nKRuIl600WAwfC-7zIswKwSKBRpGIqmdFxUK-D_fH94',
EIO: '3',
transport: 'websocket' }
Token { iss: 'https://nextcloud.ourdomain.tld',
sub: 'admin',
exp: 1611242780,
file: '7',
filename: 'Nextcloud.pdf',
displayname: 'admin',
permissions: 27 }
created room 7
user joined room 7 { displayname: 'admin',
permissions: 27,
userid: 'G0x14uIwnNSRwMmeAAAG' }
Received items []

I can't do annotations, but drawing works but isn't saved. I can't find any error-messages on client- or server-side.

On closing the document, server.js prints:

user left room 7 { displayname: 'admin',
permissions: 27,
userid: 'G0x14uIwnNSRwMmeAAAG' }
deleting empty room 7
a user disconnected

The only non 200 or 30x HTTP codes i noticed was a '101 Switching Protocols' from socket.io, which should be ok.

I tried for days, but couldn't find the problem... (i tried first on an active install of NC20 on a Ubuntu18, but had dependencies problems, so i started with a fresh maschine, the one i described here)

Any help is much appreciated!

Save PDF instead of download only

Could it be possible to save the annotated PDF to the original file instead of being able to only download it? Like a "save"-button in the secondary toolbar right next to the download button. That would be awesome.

We are using this plugin to annotate documents in the nextcloud for some users. They have to be able to see the annotations. So the current workflow is: The annotator opens a PDF file from a user, annotates it, then downloads it. Then he deletes the original file and uploads the annotated file. That could be much simpler if there were a save button which just combines the annotations and the pdf and saves it to the path of the original file.

Is this somehow possible?

Best regards,
elvirus

docker container

Would it be difficult to create a docker container for the backend server?

NC25

Update for NC 25

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.