In my battle against cheating (I am a teacher), I would like to convert my LaTex PDF's to images so that students cannot cut and paste out of the files. I am currently using ImageMagick to do this:
convert -density 300 mwe.pdf mwe_convert.pdf
While this works, when zoomed insufficiently on the PDF aliasing causes unfortunate problems. My understanding is that antialiasing is on by default in convert (https://legacy.imagemagick.org/Usage/antialiasing/)
If I instead use the following command, things are better:
convert -density 800 -resample 300 mwe.pdf mwe_convert.pdf
With this PDF, as I zoom in and out it does a better job of preserving fine lines in the file. I'm guessing I'm getting some different type of effective antialiasing by doing this, but the options to convert have outsmarted me.
The problem is that using density and resample causes the paper size in mwe_convert.pdf to be 3.19 × 4.12 inch (according to identify). This means that viewing the file causes it to open small on the screen, and that you need crazy magnifications to make it readable on the screen.
So my question for the crowd is, is there (a) a way to do the density/resample and get the correct paper size at the end, or (b) a better way to achieve my goal.
I cannot include a PDF here as an MWE. I can show what I'm seeing. Here's a screen shot of the original LaTex PDF.
Here's a screen shot of the -density 300 without the resample:
Here's a screen shot of the -density 800 -resample 300. Note that the PDF was even smaller on the screen and the equals sign was still visible.
question from:
https://stackoverflow.com/questions/65921201/convert-latex-pdf-from-vector-to-raster 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…