Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling go #10

Open
VCTR18 opened this issue Apr 9, 2021 · 6 comments
Open

Compiling go #10

VCTR18 opened this issue Apr 9, 2021 · 6 comments

Comments

@VCTR18
Copy link

VCTR18 commented Apr 9, 2021

I don't know much about the language, can I simply download it and compile the code from main.go or it's somehow more complicated? If it is, could you please facilitate the steps?
Thanks in advance

@arthur-quadros
Copy link

Hello VCTR18, I awalys use 'Method1_Script' as a north.

To be more precisely, what are your doubts?

@VCTR18
Copy link
Author

VCTR18 commented Apr 9, 2021

i want to compile the binaries in sources. But I can't because it uses a couple of custom libraries

@arthurhess
Copy link

+1 on this. I also would like to build from source

@VCTR18
Copy link
Author

VCTR18 commented Jun 7, 2021

+1 on this. I also would like to build from source

I ended up writing a bash script, for linux. Are you interested?

@arthurhess
Copy link

Hi, @VCTR18. I just saw your reply. Yes, it would be wonderful if you could share it, thanks!

@VCTR18
Copy link
Author

VCTR18 commented Jun 16, 2021

Hi, @VCTR18. I just saw your reply. Yes, it would be wonderful if you could share it, thanks!

#!/bin/bash

#Requires base64 which I suspect comes with ubuntu and an imageMagick utility called convert
#Also I didn't managed to get the last page, but it's usually the back cover so I didn't lose my sleep for it, i'm sorry
#I use this along method 1, but replacing line 39 with <<anchorElement.download = pdfDocumentName;>>

pos=$(pwd)
mkdir -p "$1"_folder
cd "$1"_folder
mkdir -p pages
cd pages
empt=''
rm="data:image/png;base64,"
counter=0

echo "Extrayendo paginas/Extracting pages"

while read line
do
    if echo "$line" | grep -q $rm; then
        if (( counter )); then
            echo "$data_img" | base64 -di - > $counter.png
        fi
        data_img="${line/$rm/$empt}"
        let "counter++"
    else
        data_img+=$line$'\n'
    fi
    
done < ../../"$1"

echo "$data_img" | base64 -di - > $counter.png

echo "Páginas extraidas, convirtiendo a pdf/Pages extracted, converting to pdf"

convert $(ls -1v) ../$1.pdf 
cd $pos

echo "PDF completado/PDF completed"
    

Hope it helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants