Page 1 of 1

PDF thumbnail

Posted: 2012-10-11T07:37:04-07:00
by sleroux
When i try to create a thumbnail of http://repositorio.ul.pt/bitstream/1045 ... 086281.pdf (convert doc.pdf[0] thumb.png ), the thumbnail is not correct (i get a PNG with the half left white, and the half right with the thumbnail). Any solution?

Re: PDF thumbnail

Posted: 2012-10-11T09:37:48-07:00
by fmw42
try removing any possible virtual-canvas

convert +repage doc.pdf[0] thumb.png

or possibly

convert doc.pdf[0] +repage thumb.png

Re: PDF thumbnail

Posted: 2012-10-11T10:09:27-07:00
by sleroux
No luck. The command didn't change the thumbnail.
Image
Notes:
1 - The pdf is not A4
2 - Thumbnails of other pages than the first one are created correctly.

Re: PDF thumbnail

Posted: 2012-10-11T10:11:48-07:00
by fmw42
I cannot download your pdf to test. It cannot find the server.

Re: PDF thumbnail

Posted: 2012-10-11T10:17:03-07:00
by sleroux

Re: PDF thumbnail

Posted: 2012-10-11T14:01:15-07:00
by fmw42
Your file has many pages and they are not all the same size. Especially the first page is padded with lots of white, but has a bounding box.

Code: Select all

identify 9789729086250.pdf
9789729086250.pdf[0] PDF 1274x908 1274x908+0+0 16-bit Bilevel Gray 145KB 0.120u 0:00.109
9789729086250.pdf[1] PDF 595x842 595x842+0+0 16-bit Bilevel Gray 145KB 0.120u 0:00.109
9789729086250.pdf[2] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.110u 0:00.099
9789729086250.pdf[3] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.110u 0:00.099
9789729086250.pdf[4] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.110u 0:00.099
9789729086250.pdf[5] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.110u 0:00.099
9789729086250.pdf[6] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.110u 0:00.099
9789729086250.pdf[7] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.110u 0:00.099
9789729086250.pdf[8] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.110u 0:00.099
9789729086250.pdf[9] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.110u 0:00.089
9789729086250.pdf[10] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.100u 0:00.089
9789729086250.pdf[11] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.100u 0:00.089
9789729086250.pdf[12] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.100u 0:00.089
9789729086250.pdf[13] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.100u 0:00.089
9789729086250.pdf[14] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.100u 0:00.089
9789729086250.pdf[15] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.100u 0:00.089
9789729086250.pdf[16] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.100u 0:00.079
9789729086250.pdf[17] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.090u 0:00.079
9789729086250.pdf[18] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.080u 0:00.079
9789729086250.pdf[19] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.080u 0:00.079
9789729086250.pdf[20] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.080u 0:00.079
9789729086250.pdf[21] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.080u 0:00.079
9789729086250.pdf[22] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.080u 0:00.069
9789729086250.pdf[23] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.080u 0:00.069
9789729086250.pdf[24] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.080u 0:00.069
9789729086250.pdf[25] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.080u 0:00.069
9789729086250.pdf[26] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.070u 0:00.069
9789729086250.pdf[27] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.070u 0:00.069
9789729086250.pdf[28] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.070u 0:00.069
9789729086250.pdf[29] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.070u 0:00.059
9789729086250.pdf[30] PDF 595x842 595x842+0+0 16-bit Bilevel Gray 145KB 0.070u 0:00.059
9789729086250.pdf[31] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.070u 0:00.059
9789729086250.pdf[32] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.070u 0:00.059
9789729086250.pdf[33] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.070u 0:00.059
9789729086250.pdf[34] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.060u 0:00.059
9789729086250.pdf[35] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.060u 0:00.059
9789729086250.pdf[36] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.060u 0:00.049
9789729086250.pdf[37] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.060u 0:00.049
9789729086250.pdf[38] PDF 595x842 595x842+0+0 16-bit Bilevel Gray 145KB 0.060u 0:00.049
9789729086250.pdf[39] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.060u 0:00.049
9789729086250.pdf[40] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.060u 0:00.049
9789729086250.pdf[41] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.060u 0:00.049
9789729086250.pdf[42] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.050u 0:00.049
9789729086250.pdf[43] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.050u 0:00.039
9789729086250.pdf[44] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.050u 0:00.039
9789729086250.pdf[45] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.050u 0:00.039
9789729086250.pdf[46] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.050u 0:00.039
9789729086250.pdf[47] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.050u 0:00.039
9789729086250.pdf[48] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.050u 0:00.039
9789729086250.pdf[49] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.050u 0:00.039
9789729086250.pdf[50] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.040u 0:00.029
9789729086250.pdf[51] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.040u 0:00.029
9789729086250.pdf[52] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.040u 0:00.029
9789729086250.pdf[53] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.040u 0:00.029
9789729086250.pdf[54] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.040u 0:00.029
9789729086250.pdf[55] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.040u 0:00.029
9789729086250.pdf[56] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.040u 0:00.019
9789729086250.pdf[57] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.040u 0:00.019
9789729086250.pdf[58] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.030u 0:00.029
9789729086250.pdf[59] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.030u 0:00.029
9789729086250.pdf[60] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.030u 0:00.029
9789729086250.pdf[61] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.030u 0:00.029
9789729086250.pdf[62] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.030u 0:00.029
9789729086250.pdf[63] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.030u 0:00.019
9789729086250.pdf[64] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.030u 0:00.019
9789729086250.pdf[65] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.030u 0:00.019
9789729086250.pdf[66] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.010u 0:00.019
9789729086250.pdf[67] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.010u 0:00.019
9789729086250.pdf[68] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.010u 0:00.019
9789729086250.pdf[69] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.010u 0:00.019
9789729086250.pdf[70] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.010u 0:00.009
9789729086250.pdf[71] PDF 666x912 666x912+0+0 16-bit Bilevel Gray 145KB 0.010u 0:00.009
9789729086250.pdf[72] PDF 595x842 595x842+0+0 16-bit Bilevel Gray 145KB 0.010u 0:00.009
9789729086250.pdf[73] PDF 595x842 595x842+0+0 16-bit Bilevel Gray 145KB 0.010u 0:00.009
c-98-234-217-52:~ fred$ idv 9789729086250.pdf[0]
Image: 9789729086250.pdf
  Base filename: 9789729086250.pdf
  Format: PDF (Portable Document Format)
  Class: DirectClass
  Geometry: 1274x908+0+0
  Resolution: 72x72
  Print size: 17.6944x12.6111
  Units: Undefined
  Type: ColorSeparation
  Base type: ColorSeparation
  Endianess: Undefined
  Colorspace: CMYK
  Depth: 16/8-bit
  Channel depth:
    cyan: 8-bit
    magenta: 8-bit
    yellow: 8-bit
    black: 8-bit
  Channel statistics:
    Cyan:
      min: 0 (0)
      max: 47288 (0.721569)
      mean: 13819.9 (0.210878)
      standard deviation: 16909.8 (0.258027)
      kurtosis: -1.50281
      skewness: 0.531178
    Magenta:
      min: 0 (0)
      max: 44461 (0.678431)
      mean: 12674.2 (0.193396)
      standard deviation: 15667.6 (0.239072)
      kurtosis: -1.37995
      skewness: 0.590009
    Yellow:
      min: 0 (0)
      max: 65535 (1)
      mean: 25688.4 (0.39198)
      standard deviation: 30527.5 (0.465819)
      kurtosis: -1.78442
      skewness: 0.393791
    Black:
      min: 0 (0)
      max: 58082 (0.886275)
      mean: 8806.77 (0.134383)
      standard deviation: 14391.9 (0.219607)
      kurtosis: 1.43665
      skewness: 1.59705
  Image statistics:
    Overall:
      min: 0 (0)
      max: 65535 (1)
      mean: 15247.3 (0.232659)
      standard deviation: 20435.7 (0.311829)
      kurtosis: 0.52821
      skewness: 1.28078
  Total ink density: 296%
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: cmyk(255,255,255,0)
  Border color: cmyk(223,223,223,0)
  Matte color: cmyk(189,189,189,0)
  Transparent color: cmyk(0,0,0,0)
  Compose: Over
  Page geometry: 1274x908+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2012-10-11T13:56:49-07:00
    date:modify: 2012-10-11T13:56:49-07:00
    pdf:HiResBoundingBox: 1273.56x907.89+0+0
    pdf:SpotColor-0: All
    pdf:SpotColor-1: All
    pdf:SpotColor-2: All
    pdf:Version: PDF-1.5
    signature: 906929ab002f8483eed27f4643263bcbc808e2aac2e8791533cc1df6783aa5c2
  Artifacts:
    filename: 9789729086250.pdf[0]
    verbose: true
  Tainted: False
  Filesize: 4.627MB
  Number pixels: 1.157M
  Pixels per second: 3.213MB
  User time: 0.020u
  Elapsed time: 0:01.359
  Version: ImageMagick 6.7.9-10 2012-10-06 Q16 http://www.imagemagick.org
I tried adding -strip, but that did not help. So I do not know how to get rid of the bounding box, nor if that is the real issue.

Perhaps you need to be more careful in creating the PDF file to avoid the padding

Re: PDF thumbnail

Posted: 2012-10-11T14:38:13-07:00
by sleroux
The pdf was not created by me. I'm working on a content agregator (OAI repositories) and one of the feature is the creation of thumbnails of documents ( i use im4java to generate the thumbnail, but the error is the same as with the command line). 99% of the thumbnails i create are OK. But they are some documents that are "strange". For example, the one i put the link, or PDF documents with errors (the adobe reader opens the document, but when i use image magick i get some warnings and the thumbnail generated is empty.
The problems are the documents... I was trying to verify if somebody had similar problems, to find a possible workaround. Thanks.