Page 2 of 2

Re: PDF is too small (in cm)

Posted: 2014-11-15T13:39:58-07:00
by pipitas
fmw42 wrote:I install my delegates from MacPorts, but install IM from source manually
I was trying to do exactly that recently (install IM from source -- but from current SVN, not from an officially released tarball). However, it did not compile for me.

Unfortunately, I didn't have the time to take a closer look, nor time to write up all the details in order to ask for help here. But sometime in the next two weeks I will (unless it resolves itself by some near-future SVN update).

Re: PDF is too small (in cm)

Posted: 2014-11-15T13:42:07-07:00
by fmw42
I would suggest that you use either the release or a beta rather than from SVN. I do not know much about SVN, but my technique that I mentioned earlier in this post works fine for me. It allows me to stay current with IM releases or test betas.

Re: PDF is too small (in cm)

Posted: 2014-11-15T15:34:02-07:00
by pipitas
fmw42 wrote:I install my delegates from MacPorts, but install IM from source manually. see viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202
IIRC, I tried to also compile a released source tarball (as opposed to current SVN checkout), and this also failed. I'll revisit the topic as soon as I'll have more time for it again...

Re: PDF is too small (in cm)

Posted: 2014-11-18T05:16:18-07:00
by akapuma
Hellp pepitas,

Code: Select all

   gs -o testpage.tif -sDEVICE=tiffg4 -r300 testpage.ps

   tiff2pdf -p A4 -F testpage.tif > testpage.tif.pdf
Thank you for the great idea to solve my problem with ghostscript. It works fine, but unfortunately the gs uses dithering. Any idea to convert in back/white without dithering?

Best regards

akapuma

Re: PDF is too small (in cm)

Posted: 2014-11-18T06:06:37-07:00
by pipitas
akapuma wrote:

Code: Select all

   gs -o testpage.tif -sDEVICE=tiffg4 -r300 testpage.ps

   tiff2pdf -p A4 -F testpage.tif > testpage.tif.pdf
Thank you for the great idea to solve my problem with ghostscript. It works fine, but unfortunately the gs uses dithering. Any idea to convert in back/white without dithering?
Look more closely at the result. Zoom in. Zoom in more. Look closely: The PDF page IS black/white only, and it uses a "1 bit per pixel" depth.

I would not call it "unfortunately", but "fortunately, that gs uses dithering" by default!

This is the first time you are mentioning that you want pure black/white without dithering. (You only mentioned "1 bit per pixel" before -- and this requirement is matched by my suggested procedure.)

If you do not want dithering, but black filled areas and white filled areas all over the page, you need to use a different workflow. That is also possible. Please as a new question for this, and clearly state your goals. (And please do not put your question under the "bugs" section of these forums...)

Re: PDF is too small (in cm)

Posted: 2014-11-18T06:30:22-07:00
by akapuma
Hello pipitas,
If you do not want dithering, but black filled areas and white filled areas all over the page, you need to use a different workflow. That is also possible. Please as a new question for this, and clearly state your goals.
The following command line from my first post does, what I want. Black and white without dithering:

Code: Select all

convert -limit memory 1GiB -limit map 2GiB -define registry:temporary-path="c:\tmp" -density 300x300 -page A4 -colors 2 +dither -monochrome -compress group4  input.ps output.pdf
Please as a new question for this, and clearly state your goals.
Your idea to make the TIFF without imagemagick is very good. But I will not ask for a solution in this forum. It's an imagemagick forum, not a gs forum.
(And please do not put your question under the "bugs" section of these forums...)
I defined A4, and I expected an A4 output = 21cm x 29,7cm. But I got a 5,04cm x 7,13cm file. I thought, this is a bug. Sorry for this.

Best regards

akapuma

Re: PDF is too small (in cm)

Posted: 2014-11-18T08:09:19-07:00
by pipitas
akapuma wrote:
If you do not want dithering, but black filled areas and white filled areas all over the page, you need to use a different workflow. That is also possible. Please as a new question for this, and clearly state your goals.
The following command line from my first post does, what I want. Black and white without dithering:

Code: Select all

convert -limit memory 1GiB -limit map 2GiB -define registry:temporary-path="c:\tmp" -density 300x300 -page A4 -colors 2 +dither -monochrome -compress group4  input.ps output.pdf
Please as a new question for this, and clearly state your goals.
Your idea to make the TIFF without imagemagick is very good. But I will not ask for a solution in this forum. It's an imagemagick forum, not a gs forum.
(And please do not put your question under the "bugs" section of these forums...)
I defined A4, and I expected an A4 output = 21cm x 29,7cm. But I got a 5,04cm x 7,13cm file. I thought, this is a bug. Sorry for this.
Your command's output is also "dithered" (with 1 bit depth). Just like the one from my command.

But my command's output IS A4, which is what you asked for.

I still don't understand what you don't like about my command's output when you ask for "not dithered".

Re: PDF is too small (in cm)

Posted: 2014-11-18T09:41:10-07:00
by akapuma
I think, some samples will help:

This is a text in different sizes and colors:
http://akapuma.info/sonstiges/coloured.pdf

Conversion with ghostsript only (tiff2pdf after that):

Code: Select all

gs -o testpage.tif -sDEVICE=tiffg4 -r300 testpage.ps
Result: http://akapuma.info/sonstiges/gsonly.pdf
=> the yellow text is missing
=> due to dithering, the small text is not good readable (last line)
=> correct size 21,0cm x 29,7cm

Conversion with imagemagick:

Code: Select all

convert -limit memory 1GiB -limit map 2GiB -define registry:temporary-path="c:\tmp" -density 300x300 -page A4 -colors 2 +dither -monochrome -compress group4  input.ps output.pdf
Remark: "+dither" means no dithering

Result: http://akapuma.info/sonstiges/imagemagick.pdf
=> the yellow text is readable
=> the small text is good readable (last line)
=> wrong size 5,07cm x 7,13cm

The only problem is the size of 5,07cm x 7,13cm.

Best regards

akapuma

Re: PDF is too small (in cm)

Posted: 2014-11-18T15:51:29-07:00
by snibgo
For "-page A4", see http://www.imagemagick.org/script/comma ... s.php#page

This is shorthand for "-page 595x842", which is A4 at 72 dpi. But you have 300 dpi, so the result won't be A4.

Re: PDF is too small (in cm)

Posted: 2014-11-19T00:24:40-07:00
by akapuma
This is shorthand for "-page 595x842", which is A4 at 72 dpi. But you have 300 dpi, so the result won't be A4.
That's interesting. Now, I tried:
convert -limit memory 1GiB -limit map 2GiB -define registry:temporary-path="c:\tmp" -size 2480x3508 -density 300x300 -units pixelsperinch -colors 2 +dither -monochrome -compress group4 input.ps output.pdf
21,0cm / 2,54cm/inch * 300pixels/inch = 2480pixels
29,7cm / 2,54cm/inch * 300pixels/inch = 3508pixels

The result is 20,14cm x 28,85cm. Expected was 21,0cm x 29,7cm.

The small discrepancy is unclear for me. But I can live with the new result. Thank you very much.

Best regards

akapuma

Re: PDF is too small (in cm)

Posted: 2014-11-19T09:52:10-07:00
by fmw42
I do not think -size is relevant here. It is for creating a new image, not converting. Also things like -colors +dither -monochrome -compress should come after reading the input image.

Re: PDF is too small (in cm)

Posted: 2014-11-24T03:50:16-07:00
by akapuma
fmw42 wrote:I do not think -size is relevant here.
I think, size is relevant, because the input file is not a raster file. It's a postscript, without a size in pixels.

Best regards

akapuma

Re: PDF is too small (in cm)

Posted: 2014-11-24T10:20:14-07:00
by fmw42
I am not a vector expert or expert in ps files, but the size of most vector files is controlled by the density. Perhaps ps files are different.

Re: PDF is too small (in cm)

Posted: 2014-11-24T14:50:58-07:00
by pipitas
fmw42 wrote:[...] the size of most vector files is controlled by the density. Perhaps ps files are different.
This wording is not the best to express your intended meaning.

Maybe better and technically more correct say:

"Vertical and horizontal dimensions of raster images created by converting from vector files are controlled by the '-density' parameter."