Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: convert multiple jpg to pdf issue

  1. #11

    Default Re: convert multiple jpg to pdf issue

    I had an idea. tannington recommended that need to open and save jpg files with Gimp but it is a horrible work.

    I tried to convert jpg files to jpg by convert command and create a pdf. I experienced that it works. I wrote a script to convert and create pdf from all jpg in dir.

    for file in *.jpg; do
    convert "$file" "${file%.jpg}_1.jpg"
    done
    convert *_1.jpg output.pdf

    It create an correct pdf file.

    Thank you for help.


  2. #12
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,945

    Default Re: convert multiple jpg to pdf issue

    Very good solution. I was still searching for a CLI tool that could adapt dpi, but his is good thinking.
    And thanks for reporting how you did it.
    Henk van Velden

  3. #13
    Join Date
    Sep 2013
    Location
    Norfolk, UK
    Posts
    1,430

    Default Re: convert multiple jpg to pdf issue

    Ah... Late to the party!

    Good to see your solution.

    I've just checked anyway, and yes, imagemagick can set the dpi by using the "-density" command.

    "The -density option sets an attribute and does not alter the underlying raster image. It may be used to adjust the rendered size for desktop publishing purposes by adjusting the scale applied to the pixels. To resize the image so that it is the same size at a different resolution, use the -resample option."
    Regards, Paul

    2x Tumbleweed (Snapshot: 20200314) KDE Plasma 5
    2x Leap 15.1 KDE Plasma 5

  4. #14

    Default Re: convert multiple jpg to pdf issue

    I think the problem was jpg's Color Space was Uncalibrated. After converted it is sRGB. Other jpg's parameters not changed...

    I can run a script all dir and it repair jpgs and create pdf file.

    But I'ld like to rename output.pdf finally to "dirname".pdf but I don't know how... I work on it...

    Thank you for yours help.

  5. #15

    Default Re: convert multiple jpg to pdf issue

    The Final (full) solution forrename output.pfd to dirname.pdf and includ the NGM prefix.

    File's name will be NGM_dirname.pdf. This script repairs jpgs and creates this.

    for file in *.jpg; do
    convert "$file" "${file%.jpg}_1.jpg"
    done


    convert *_1.jpg NGM_"${PWD##*/}".pdf


    rm *_1.jpg

    Thank you for your help.

    Regards

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •