sudo apt-get update && sudo apt-get install imagemagick gs
mkdir -p pdf_conversion/{merged,split}
cd pdf_conversion
| // Estimating CPU frequency... | |
| // CPU frequency: 4.52 GHz | |
| // sum1: value = 15182118497126522709, 0.31 secs, 5.14 cycles/elem | |
| // sum2: value = 15182118497126522709, 0.17 secs, 2.93 cycles/elem | |
| #define RW(x) asm("" : "+r"(x)) | |
| typedef struct Node { | |
| u64 value; | |
| struct Node *next; |
| # The first approach that I found was to convert using a virtual device using Ghostscript. | |
| # The virtual device, pdfwrite, supports parameters to convert the original PDF file to another PDF file in grayscale. | |
| # In my case, I wanted only black and white, so this was not enough. | |
| #!/bin/bash | |
| gs \ | |
| -sOutputFile=output.pdf \ | |
| -sDEVICE=pdfwrite \ | |
| -sColorConversionStrategy=Gray \ |