You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.8 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Resample (thanks OSP!) using GS (ghostscript)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"GPL Ghostscript 9.27 (2019-04-04)\n",
"Copyright (C) 2018 Artifex Software, Inc. All rights reserved.\n",
"This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:\n",
"see the file COPYING for details.\n",
"Processing pages 1 through 1.\n",
"Page 1\n",
"Loading NimbusMonoPS-Regular font from /usr/share/ghostscript/9.27/Resource/Font/NimbusMonoPS-Regular... 4732016 3198530 2340840 976702 4 done.\n"
]
}
],
"source": [
"!gs \\\n",
" -o \"resampled.pdf\" \\\n",
" -sDEVICE=pdfwrite \\\n",
" -dDownsampleColorImages=true \\\n",
" -dDownsampleGrayImages=true \\\n",
" -dDownsampleMonoImages=true \\\n",
" -dColorImageResolution=300 \\\n",
" -dGrayImageResolution=300 \\\n",
" -dMonoImageResolution=300 \\\n",
" -dColorImageDownsampleThreshold=1.0 \\\n",
" -dGrayImageDownsampleThreshold=1.0 \\\n",
" -dMonoImageDownsampleThreshold=1.0 \\\n",
" \"pdf/test.pdf\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}