Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77609 > unrolled thread

Re: Anyway to reduce size of pdf using python script.

Started bykekeje@gmail.com
First post2014-09-05 11:55 -0700
Last post2014-09-06 08:09 +0200
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Anyway to reduce size of pdf using python script. kekeje@gmail.com - 2014-09-05 11:55 -0700
    Re: Anyway to reduce size of pdf using python script. dieter <dieter@handshake.de> - 2014-09-06 08:09 +0200

#77609 — Re: Anyway to reduce size of pdf using python script.

Fromkekeje@gmail.com
Date2014-09-05 11:55 -0700
SubjectRe: Anyway to reduce size of pdf using python script.
Message-ID<034629a4-a045-4509-9b30-dcd6aea9c3e8@googlegroups.com>
On Friday, February 1, 2013 8:03:41 PM UTC-5, access...@gmail.com wrote:
> I have a batch file that exports ArcGIS pdf maps to a directory. I would like to include a step in the script where the pdf file is reduced in size instead of manually opening each file in Acrobat X Pro after the script has run and doing it there.
> 
> 
> 
> Can this be done using python scripting or does the automation stop at exporting the map?
> 
> 
> 
> Thanks



Have you found the solution? I am having exactly the same problem and happen to see your post here. Please let me know how you did it, thanks! 

[toc] | [next] | [standalone]


#77638

Fromdieter <dieter@handshake.de>
Date2014-09-06 08:09 +0200
Message-ID<mailman.13822.1409983763.18130.python-list@python.org>
In reply to#77609
kekeje@gmail.com writes:

> On Friday, February 1, 2013 8:03:41 PM UTC-5, access...@gmail.com wrote:
>> I have a batch file that exports ArcGIS pdf maps to a directory. I would like to include a step in the script where the pdf file is reduced in size instead of manually opening each file in Acrobat X Pro after the script has run and doing it there.
>> 
>> Can this be done using python scripting or does the automation stop at exporting the map?
>
> Have you found the solution? I am having exactly the same problem and happen to see your post here. Please let me know how you did it, thanks! 

Python is a (mostly) general purpose programming language.
To optimize "PDF" specialized PDF knowledge is requires - which
Python, by itself, lacks.

You may check whether "Acrobat X Pro" is scriptable (can be controlled
externally). Windows programs sometimes expose a COM interface
for such external control (also called "automation"). If "Acrobat"
supports automation via COM interfaces, the you can use Python
to "drive the automation" (some Python versions for Windows come
with COM support).

The required PDF knowledge may also come from special (Python extension)
packages. "reportlab" provides Python extensions to handle PDF.
I do not know whether this includes optimizing "PDF" (I use
a "reportlab" package to generate PDF from Python scripts).

I expect that the optimization you observe results from compressing
the images included in the PDF. If this is the case,
you could in principle write your own package to do this in Python.
You would need to learn PDF internals for this.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web