Discussion:
[Skim-app-users] Crop pdf permanently to reduce file space?
E***@web.de
2011-03-08 16:04:29 UTC
Permalink
Hi,

I've read in the discussions/FAQ that to preserve the cropped view of a pdf,
it has to be exported.

So far that works fine, however the file size did not change at all (and
opened in preview I can still see the whole original pages).

So I assume that it is still only the display of the pdf which has changed
and not the contents.

I would like to cut off the cropped margins permanently to save disk space
(and memory when working with the pdfs).

-> Is there a way to do that with Skim?

-> if no, could it be possible with another tool (commandline or whatever)
to use the cropped size defined in skim and "cut off" everything around?

Kind regards

Martin
Christiaan Hofman
2011-03-08 16:16:46 UTC
Permalink
Post by E***@web.de
Hi,
I've read in the discussions/FAQ that to preserve the cropped view of a pdf,
it has to be exported.
So far that works fine, however the file size did not change at all (and
opened in preview I can still see the whole original pages).
So I assume that it is still only the display of the pdf which has changed
and not the contents.
I would like to cut off the cropped margins permanently to save disk space
(and memory when working with the pdfs).
-> Is there a way to do that with Skim?
-> if no, could it be possible with another tool (commandline or whatever)
to use the cropped size defined in skim and "cut off" everything around?
Kind regards
Martin
There is no way to change the contents of a PDF. A PDF is a set of drawing instructions, which by itself have no direct knowledge of whether they're drawn in inside or outside the visible page space. It's not a set of pixels where you can simply remove some of them. (Well, the only way would be to turn it into a set of pixels, i.e. an image, crop those pixels, and convert back to PDF. However that will almost certainly increase the file size and decrease the quality.)

Christiaan
jeff newman
2011-03-08 16:24:11 UTC
Permalink
Post by E***@web.de
I would like to cut off the cropped margins permanently to save disk space
(and memory when working with the pdfs).
-> Is there a way to do that with Skim?
If you don't have any notes, etc. attached to the PDF you can use the "PDF"
menu in the print dialogue to save as a PDF. This will print with your
crops. The only catch is that you have to adjust the size of the paper to
fit the size of your cropped pages.
--
Jeff Newman
E***@web.de
2011-03-09 06:09:02 UTC
Permalink
Re: [Skim-app-users] Crop pdf permanently to reduce file space?
There is no way to change the contents of a PDF. A PDF is a set of drawing
instructions, which by itself have no direct knowledge of whether they're
drawn in inside or outside the visible page space. It's not a set of pixels
where you can simply remove some of them. (Well, the only way would be to turn
it into a set of pixels, i.e. an image, crop those pixels, and convert back to
PDF. However that will almost certainly increase the file size and decrease
the quality.)
Christiaan
----
Re: [Skim-app-users] Crop pdf permanently to reduce file space?
If you don't have any notes, etc. attached to the PDF you can use the "PDF"
menu in the print dialogue to save as a PDF. This will print with your
crops. The only catch is that you have to adjust the size of the paper to
fit the size of your cropped pages.
--
Jeff Newman
Hi Christiaan and Jeff,

thank you for your answers.

@Christiaan:
You're right. I forgot to mention a "small" (but important) detail:
We're talking about pdf files containing one scanned image per page and a
text layer created by OCR (DevonThink Pro Office with Abbyy OCR Engine).

So I think theoretically it should be possible to reduce file size "cut off"
something by cropping the embedded images.

But could there be a way to do that without (manually) exporting the image
to an external file, cropping there and importing it at the "same" position
in the cropbox, so that there is no offset regarding the OCR layer?

Most of those pdfs do not contain Skim notes yet.
If they do, I understand that cropping them without Skim knowing about it
creates a problem, because the notes seem to be placed with x/y coordinates
referring to the original page size.

@Jeff:
I tried that (printing to a pdf), and
yes, then I can't display the original whole pages in Skim or Preview any
more (by selecting media frame)
but no, the file size did not change at all. :-(

Kind regards

Martin
Christiaan Hofman
2011-03-09 10:43:47 UTC
Permalink
Post by E***@web.de
Re: [Skim-app-users] Crop pdf permanently to reduce file space?
There is no way to change the contents of a PDF. A PDF is a set of drawing
instructions, which by itself have no direct knowledge of whether they're
drawn in inside or outside the visible page space. It's not a set of pixels
where you can simply remove some of them. (Well, the only way would be to turn
it into a set of pixels, i.e. an image, crop those pixels, and convert back to
PDF. However that will almost certainly increase the file size and decrease
the quality.)
Christiaan
----
Re: [Skim-app-users] Crop pdf permanently to reduce file space?
If you don't have any notes, etc. attached to the PDF you can use the "PDF"
menu in the print dialogue to save as a PDF. This will print with your
crops. The only catch is that you have to adjust the size of the paper to
fit the size of your cropped pages.
--
Jeff Newman
Hi Christiaan and Jeff,
thank you for your answers.
We're talking about pdf files containing one scanned image per page and a
text layer created by OCR (DevonThink Pro Office with Abbyy OCR Engine).
So I think theoretically it should be possible to reduce file size "cut off"
something by cropping the embedded images.
But could there be a way to do that without (manually) exporting the image
to an external file, cropping there and importing it at the "same" position
in the cropbox, so that there is no offset regarding the OCR layer?
No.
Post by E***@web.de
Most of those pdfs do not contain Skim notes yet.
If they do, I understand that cropping them without Skim knowing about it
creates a problem, because the notes seem to be placed with x/y coordinates
referring to the original page size.
That's correct.
Post by E***@web.de
I tried that (printing to a pdf), and
yes, then I can't display the original whole pages in Skim or Preview any
more (by selecting media frame)
but no, the file size did not change at all. :-(
Kind regards
Martin
That's doing the same as saving with a crop, except that it also changes the media box.

Christiaan
E***@web.de
2011-03-09 11:03:53 UTC
Permalink
Thanks Christiaan for your help.

So the only way to "really" crop the file would be to export the images,
crop them externally, create a new pdf and redo the OCR. :-(

Could there be a way to "exchange" an image embedded in a pdf?

Martin
Antworten an: For general discussion about using Skim
Datum: Wed, 9 Mar 2011 11:43:47 +0100
An: For general discussion about using Skim
Betreff: Re: [Skim-app-users] Crop pdf permanently to reduce file space?
Post by E***@web.de
But could there be a way to do that without (manually) exporting the image
to an external file, cropping there and importing it at the "same" position
in the cropbox, so that there is no offset regarding the OCR layer?
No.
Post by E***@web.de
Most of those pdfs do not contain Skim notes yet.
If they do, I understand that cropping them without Skim knowing about it
creates a problem, because the notes seem to be placed with x/y coordinates
referring to the original page size.
That's correct.
Post by E***@web.de
I tried that (printing to a pdf), and
yes, then I can't display the original whole pages in Skim or Preview any
more (by selecting media frame)
but no, the file size did not change at all. :-(
That's doing the same as saving with a crop, except that it also changes the
media box.
Christiaan
-
Christiaan Hofman
2011-03-09 11:08:24 UTC
Permalink
Post by E***@web.de
Thanks Christiaan for your help.
So the only way to "really" crop the file would be to export the images,
crop them externally, create a new pdf and redo the OCR. :-(
Could there be a way to "exchange" an image embedded in a pdf?
Martin
Certainly not in Skim, you'd need a PDF editor like Acrobat Pro to change a PDF.

Christiaan
Post by E***@web.de
Antworten an: For general discussion about using Skim
Datum: Wed, 9 Mar 2011 11:43:47 +0100
An: For general discussion about using Skim
Betreff: Re: [Skim-app-users] Crop pdf permanently to reduce file space?
Post by E***@web.de
But could there be a way to do that without (manually) exporting the image
to an external file, cropping there and importing it at the "same" position
in the cropbox, so that there is no offset regarding the OCR layer?
No.
Post by E***@web.de
Most of those pdfs do not contain Skim notes yet.
If they do, I understand that cropping them without Skim knowing about it
creates a problem, because the notes seem to be placed with x/y coordinates
referring to the original page size.
That's correct.
Post by E***@web.de
I tried that (printing to a pdf), and
yes, then I can't display the original whole pages in Skim or Preview any
more (by selecting media frame)
but no, the file size did not change at all. :-(
That's doing the same as saving with a crop, except that it also changes the
media box.
Christiaan
-
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Skim-app-users mailing list
https://lists.sourceforge.net/lists/listinfo/skim-app-users
Charles Turner
2011-03-09 11:28:36 UTC
Permalink
Post by E***@web.de
So the only way to "really" crop the file would be to export the images,
crop them externally, create a new pdf and redo the OCR. :-(
Just FYI, Acrobat Pro (v.8 which came free with my scanner) will respect your crops when exporting to image files. So my workflow is:

Scan
Open in Acrobat and crop when necessary
If so:
Crop in Acrobat
Export as TIFF to a folder
Remake TIFFs as PDF in Acrobat
Import into DTPO
OCR

My input files are mostly xeroxes of pretty varied print formats in a number of languages and sizes, so the "scan into DTPO" feature of that application really doesn't buy me much. The scans I crop are in the minority, but the process couldn't take more than a minute per document.

HTH, Charles
E***@web.de
2011-03-09 15:48:52 UTC
Permalink
Thanks, Charles,

AFAIK GraphicConverter can also export a PDF to single images (and it lets
you choose the dpi resolution and if you want to use the crop box or the
media box in a dialog).

However,
a) I don't have Acrobat Pro available on my MacBook
b) I think/fear that exporting is not done that quickly (my MacBook is
nearly 4 years old and tired)
c) I'd have to do the OCR again which also was quite time consuming...
d) cropping each picture would be quite a lot of work - do you know about a
tool which could automatically crop white or black margins from images?


But as you mention Acrobat Pro:
doesn't it also have a feature to delete unused parts of the pdf?

(BTW: As time is short, I've found another solution for reducing file size:
reducing dpi and using compression with OS X tools, see
http://discussions.apple.com/thread.jspa?threadID=1292868&start=0&tstart=0)
I'll keep a backup of the original pdfs in case I need to extract a graph in
better resolution.)

Another hint for those with simlar problems:
I found the platform independant freeware briss
(http://briss.sourceforge.net/) which can crop similar to Skim, but it also
provides a merged view of all even and uneven pages to select a region where
all pages fit in).

kind regards

Martin
Antworten an: For general discussion about using Skim
Datum: Wed, 09 Mar 2011 06:28:36 -0500
An: For general discussion about using Skim
Betreff: Re: [Skim-app-users] Crop pdf permanently to reduce file space?
Post by E***@web.de
So the only way to "really" crop the file would be to export the images,
crop them externally, create a new pdf and redo the OCR. :-(
Just FYI, Acrobat Pro (v.8 which came free with my scanner) will respect your
Scan
Open in Acrobat and crop when necessary
Crop in Acrobat
Export as TIFF to a folder
Remake TIFFs as PDF in Acrobat
Import into DTPO
OCR
My input files are mostly xeroxes of pretty varied print formats in a number
of languages and sizes, so the "scan into DTPO" feature of that application
really doesn't buy me much. The scans I crop are in the minority, but the
process couldn't take more than a minute per document.
HTH, Charles
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Skim-app-users mailing list
https://lists.sourceforge.net/lists/listinfo/skim-app-users
Christiaan Hofman
2011-03-09 17:47:09 UTC
Permalink
Post by E***@web.de
Thanks, Charles,
AFAIK GraphicConverter can also export a PDF to single images (and it lets
you choose the dpi resolution and if you want to use the crop box or the
media box in a dialog).
However,
a) I don't have Acrobat Pro available on my MacBook
b) I think/fear that exporting is not done that quickly (my MacBook is
nearly 4 years old and tired)
c) I'd have to do the OCR again which also was quite time consuming...
d) cropping each picture would be quite a lot of work - do you know about a
tool which could automatically crop white or black margins from images?
Quite frankly, I really don't see why you would even want to bother. What you crop will typically not be any contents, so the amount of data you will save will be small, if not negative.
Post by E***@web.de
doesn't it also have a feature to delete unused parts of the pdf?
reducing dpi and using compression with OS X tools, see
http://discussions.apple.com/thread.jspa?threadID=1292868&start=0&tstart=0)
I'll keep a backup of the original pdfs in case I need to extract a graph in
better resolution.)
I found the platform independant freeware briss
(http://briss.sourceforge.net/) which can crop similar to Skim, but it also
provides a merged view of all even and uneven pages to select a region where
all pages fit in).
That's what Skim also does / can do, see the Wiki.

Christiaan
Post by E***@web.de
kind regards
Martin
Antworten an: For general discussion about using Skim
Datum: Wed, 09 Mar 2011 06:28:36 -0500
An: For general discussion about using Skim
Betreff: Re: [Skim-app-users] Crop pdf permanently to reduce file space?
Post by E***@web.de
So the only way to "really" crop the file would be to export the images,
crop them externally, create a new pdf and redo the OCR. :-(
Just FYI, Acrobat Pro (v.8 which came free with my scanner) will respect your
Scan
Open in Acrobat and crop when necessary
Crop in Acrobat
Export as TIFF to a folder
Remake TIFFs as PDF in Acrobat
Import into DTPO
OCR
My input files are mostly xeroxes of pretty varied print formats in a number
of languages and sizes, so the "scan into DTPO" feature of that application
really doesn't buy me much. The scans I crop are in the minority, but the
process couldn't take more than a minute per document.
HTH, Charles
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Skim-app-users mailing list
https://lists.sourceforge.net/lists/listinfo/skim-app-users
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Skim-app-users mailing list
https://lists.sourceforge.net/lists/listinfo/skim-app-users
Peter Horn
2011-03-09 19:01:08 UTC
Permalink
Regarding cropping pdf...

Christiaan, you seem like you don't want Skim to crop to the media box. ("Quite
frankly, I really don't see why you would even want to bother. What you crop
will typically not be any contents, so the amount of data you will save will
be small, if not negative.") Some of us do want to crop to media box, for
various reasons. Some people think it will save file space. I want to do
it just to eliminate big margins.

Skim actually *can* crop to the media box. To get Skim to do this, you have
to modify the source code. I did, and it works.

This matter has been under discussion for a while, and I think Skim should
allow people to crop to media box, if that's what the people want!

Best,
Peter Horn
Christiaan Hofman
2011-03-09 22:10:27 UTC
Permalink
Post by Peter Horn
Regarding cropping pdf...
Christiaan, you seem like you don't want Skim to crop to the media box. ("Quite frankly, I really don't see why you would even want to bother. What you crop will typically not be any contents, so the amount of data you will save will be small, if not negative.") Some of us do want to crop to media box, for various reasons. Some people think it will save file space. I want to do it just to eliminate big margins.
Skim actually can crop to the media box. To get Skim to do this, you have to modify the source code. I did, and it works.
This matter has been under discussion for a while, and I think Skim should allow people to crop to media box, if that's what the people want!
Best,
Peter Horn
Media box or crop box makes no difference in file size, it essentially behaves exactly the same: it hides content rather than remove content. It just does so in somewhat different situations. But generically, for most displays and also for printing, they are exactly equivalent.

My remark was about the file size, and therefore has nothing to do with media boxes.

And as for the last remark, I already explained many times why that's completely irrelevant, if not incorrect.

Christiaan

E***@web.de
2011-03-09 19:06:50 UTC
Permalink
Hello Christiaan,
Post by Christiaan Hofman
Quite frankly, I really don't see why you would even want to bother. What you
crop will typically not be any contents, so the amount of data you will save
will be small, if not negative.
Just an example:
I saved one page of a scanned book page (typical copy of conference
proceedings with a large black margin):
-> PNG of 950 kB in Size
I cropped the black margins and saved the png -> 480 kB in Size!

that's 49% saved!
So just by removing the borders I could reduce file size to 50% and then
even more with compression and reduction of the image resolution.
However, as compression might be a potential loss of data and information,
this "real crop" would be no loss at all...
Post by Christiaan Hofman
Post by E***@web.de
(http://briss.sourceforge.net/) which can crop similar to Skim, but it also
provides a merged view of all even and uneven pages to select a region where
all pages fit in).
That's what Skim also does / can do, see the Wiki.
I know that there is an auto crop feature, but I did not find a way to
graphically show a merge of all pages in Skim, so that the user could adjust
the area to crop "visually" (e. g. decide, if he does not want to leave the
page numbers at the bottom).

Kind regards

Martin
Post by Christiaan Hofman
Antworten an: For general discussion about using Skim
Datum: Wed, 9 Mar 2011 18:47:09 +0100
...
Post by E***@web.de
(http://briss.sourceforge.net/) which can crop similar to Skim, but it also
provides a merged view of all even and uneven pages to select a region where
all pages fit in).
That's what Skim also does / can do, see the Wiki.
Christiaan
Post by E***@web.de
kind regards
Martin
Christiaan Hofman
2011-03-09 22:07:01 UTC
Permalink
Post by E***@web.de
Hello Christiaan,
Post by Christiaan Hofman
Quite frankly, I really don't see why you would even want to bother. What you
crop will typically not be any contents, so the amount of data you will save
will be small, if not negative.
I saved one page of a scanned book page (typical copy of conference
-> PNG of 950 kB in Size
I cropped the black margins and saved the png -> 480 kB in Size!
that's 49% saved!
So just by removing the borders I could reduce file size to 50% and then
even more with compression and reduction of the image resolution.
However, as compression might be a potential loss of data and information,
this "real crop" would be no loss at all...
This is really a big exceptions, most pages are white, i.e. empty, in the background.

I make programs for many people taking into account general usage, not special case apps for very special individuals in very specific and non-generic situations.
Post by E***@web.de
Post by Christiaan Hofman
Post by E***@web.de
(http://briss.sourceforge.net/) which can crop similar to Skim, but it also
provides a merged view of all even and uneven pages to select a region where
all pages fit in).
That's what Skim also does / can do, see the Wiki.
I know that there is an auto crop feature, but I did not find a way to
graphically show a merge of all pages in Skim, so that the user could adjust
the area to crop "visually" (e. g. decide, if he does not want to leave the
page numbers at the bottom).
Kind regards
Martin
That's right. Though you can use the Select Content feature and then adjust the box, then crop.

Christiaan
Post by E***@web.de
Post by Christiaan Hofman
Antworten an: For general discussion about using Skim
Datum: Wed, 9 Mar 2011 18:47:09 +0100
...
Post by E***@web.de
(http://briss.sourceforge.net/) which can crop similar to Skim, but it also
provides a merged view of all even and uneven pages to select a region where
all pages fit in).
That's what Skim also does / can do, see the Wiki.
Christiaan
Post by E***@web.de
kind regards
Martin
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Skim-app-users mailing list
https://lists.sourceforge.net/lists/listinfo/skim-app-users
Continue reading on narkive:
Loading...