New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/riadvice/bigbluebutton-annotations-api-server

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/riadvice/bigbluebutton-annotations-api-server

  • v0.0.0-20211129150155-c3a54bac2084
  • Source
  • Go
  • Socket score

Version published
Created
Source

BigBlueButton PDF Annotations Server

Development environment

If you want to use virtualisation to run the project, you need to have vagrant installed.

Env vars

Add the following lines to your .profile

export GOROOT=/usr/local/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH 

source .profile

How to run?

cd /app or app alias if you are under vagrant

go get github.com/gorilla/mux

go get github.com/jung-kurt/gofpdf

go get github.com/llgcode/draw2d

go get github.com/spf13/viper

go get github.com/sirupsen/logrus

go get github.com/01walid/goarabic

go get github.com/pdfcpu/pdfcpu

Required packages for Python scripts: pip install PyPDF2

librsvg2-bin required for svg to pdf conversion (rsvg-convert)

sudo apt-get install librsvg2-bin Run with go run main.go

  • start local server on port 8100

    • Listen for GET request on : http://127.0.0.1:8100/{meetingID}/{presentationID}

      Response: Download pdf file (local location : /tmp/presentationID-final/presentationID.pdf)

    • Listen for POST request on : http://127.0.0.1:8100/{meetingID}/{presentationID} example request (post.sh) Response: Download pdf file (local location : /tmp/presentationID-final/presentationID.pdf)

    • Listen for GET request on : http://127.0.0.1:8100/{meetingID}/{presentationID}/{PageNumber}

      Response: Download pdf file of the wanted page only (local location : /tmp/presentationID-pages-done/presentationID_PageNumber.pdf)

  • Create pdf file of the desired presentation with annotations on it

    • go fetch on /var/bigbluebutton/meetingID/meetingID/presentationID
      • if pdf file (presentationID.pdf) exists
        • split the pdf file into single pdf pages and save them on /tmp/presentationID-pages
        • add annotations on every page
          • get the annotations details of each page from /var/bigbluebutton/MeetingID/events.xml
          • draw on each page it's annotations and save the page on /tmp/presentationID-done
        • merge the pdf pages on /tmp/presentationID-done on one pdf file and save in /tmp/presentationID-final
      • if the source presentation is in other format than pdf
        • convert the svgs /var/bigbluebutton/meetingID/presentationID/svgs to pdf files and save them to /tmp/presentationID-pages
        • add annotations on every page
          • get the annotations details of each page from /var/bigbluebutton/MeetingID/events.xml
          • draw on each page it's annotations and save the page on /tmp/presentationID-done
        • merge the pdf pages on /tmp/presentationID-done on one pdf file and save in /tmp/presentationID-final

PDF export API

Run API with go run main.go

Main options

  • Download Presentation PDF
    • [From events.xml] : GET /MeetingID/PresentationID
    • [From JSON body] : GET /MeetingID/PresentationID
  • Download one page from Presentation PDF
    • [from events.xml] : GET /MeetingID/PresentationID/PageNumber

Configuration variables

  • port (listening port for api , 8100)
  • OutputPath: (temp path , /tmp/)
  • BBBPresPath: (presentation location , /var/bigbluebutton/)
  • ScriptDir: (python scripts location , /usr/share/bbb-api-pyscript/)
  • EventsPath: (events.xml file location , /var/bigbluebutton/)
  • FontPath: ( Arial.ttf font location , /usr/share/fonts/)

Example Requests:

 {
  "_eventname": "AddShapeEvent",
  "presentation": "07bfb86c086066090f39d810096a329151261aec-1634463976664",
  "whiteboardId": "07bfb86c086066090f39d810096a329151261aec-1634463976664/1",
  "pageNumber": 0,
  "type": "pencil",
  "position": 0,
  "dataPoints": "20.768291,44.483734,28.794786,43.68109,36.86562,44.239834,44.91463,44.239834",
  "color": 16711680,
  "thickness": 0.3658536585365854,
  "dimensions": "List(547, 410)",
  "commands": "1,4"
 },
 {
  "_eventname": "AddShapeEvent",
  "presentation": "07bfb86c086066090f39d810096a329151261aec-1634463976664",
  "whiteboardId": "07bfb86c086066090f39d810096a329151261aec-1634463976664/2",
  "pageNumber": 1,
  "type": "text",
  "x": 52.42053561740452,
  "y": 52.905454282407405,
  "fontColor": 255,
  "textBoxWidth": 31.723717583550346,
  "textBoxHeight": 8.80195900245949,
  "text": "Test text",
  "fontSize": 20,
  "calcedFontSize": 4.88997555012225,
  "position": 0,
  "dataPoints": "52.42053561740452,52.905454282407405"
 }
]'

Convert XML to json annotations

Just use test.go application

FAQs

Package last updated on 29 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc