Skip to content

Commit

Permalink
pdf compression function update
Browse files Browse the repository at this point in the history
  • Loading branch information
mschart authored Sep 20, 2024
1 parent b5452bf commit 3827cc4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions brainwidemap/meta/bwm_figs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,8 @@ def plot_bar_neuron_count(table_only=False, ssvers='_rerun'):
r.append(a)

df = pd.DataFrame(data=r,columns=columns)
df = df.reindex(index=df.index[::-1])
df = df.reindex(index=df.index[::-1])
df.reset_index(drop=True, inplace=True)
df.to_csv(meta_pth / 'region_info.csv')

print('saving table only')
Expand Down Expand Up @@ -3333,10 +3334,12 @@ def ax_str(x):



def ghostscript_compress_pdf(variable):
def ghostscript_compress_pdf(variable, level='/printer'):

'''
Compress main figs (inkscape pdfs) or whole manuscript
Compress main figs (inkscape pdfs) or whole manuscript
levels in [/screen, /ebook, /printer]
'''


Expand Down Expand Up @@ -3371,7 +3374,8 @@ def ghostscript_compress_pdf(variable):
# Ghostscript command to compress PDF
command = [
'gs', '-sDEVICE=pdfwrite', '-dCompatibilityLevel=1.4',
'-dPDFSETTINGS=/ebook', '-dNOPAUSE', '-dQUIET', '-dBATCH',
'-dAutoRotatePages=/None',
f'-dPDFSETTINGS={level}', '-dNOPAUSE', '-dQUIET', '-dBATCH',
f'-sOutputFile={output_path}', input_path
]

Expand Down

0 comments on commit 3827cc4

Please sign in to comment.