0

I have have scanned an A4R paper sheet to a 2048x1443 jpg file.

EDIT1 : It's already rotated to landscape (2048x1443). END OF EDIT1

Now if I try convert it with this command :

$ convert -page A4R A4R_Scanned.jpg A4R_Scanned.pdf
$ echo $?
0

EDIT2 : There was no error message regarding the A4R argument. END OF EDIT2

I get a blank US Letter, Portrait page :

$ identify A4R_Scanned.pdf
   **** Warning:  File has an empty MediaBox. Using the current page size instead.
                  Output may be incorrect.
   **** Warning:  File has an empty MediaBox. Using the current page size instead.
                  Output may be incorrect.
A4R_Scanned.pdf PDF 595x842 595x842+0+0 16-bit Bilevel DirectClass 63.2K 

EDIT3 : I tried another solution :

$ convert -page A4 -rotate 90 A4R_Scanned.jpg A4R_Scanned2A4.pdf

This gives a satisfying A4 document with no visible quality loss but I need to rotate it back to have an A4R (landscape).

When I do that, more quality is lost and that's visible :

$ convert -rotate -90 A4R_Scanned2A4.pdf A4R_Scanned2A4R.pdf

Now, my question is : How do I rotate the document back without loosing too much quality ?

END OF EDIT3

EDIT4 : Thanks to dirkt, the conversion can be done in one step and the quality is good :-) :

$ convert -page 842x595 A4R_Scanned.jpg A4R_Scanned2A4R.pdf

END OF EDIT4

1

A simple look at the documentation of the -page command line options shows that A4R doesn't exist (and I've never heard of a format with this name). If you mean A4, use -page A4 instead. If you mean something like "A4 with an extra feature that's called R", you possibly have to do some extra things for "R", whatever that is.

Edit: If "R" means "rotated", have a look at the -rotate option.

I wouldn't be surprised if you also got an error message while calling convert which complained about this.

Edit

If I understand the edit's correctly, the problem is that you want landscape without rotating. The problem here is that the PDF format has various ways to flag "landscape": You can either have actual landscape (bounding box width greater than height), or you can store a portrait image and add a \Rotation entry. (Also see this question). And what various tools do in this respect is always a bit hit or miss.

One of the simplest things you can try is to use -page 842x595 (A4 is just a shorthand for 595x842) and see what happens.

Anything else will probably require to take a closer look at what happens by inspecting the PDFs that are generated by your imagemagick/graphicsmagick convert and you current version.

  • 1
    A4R sounds to me like a shorthand some multifunction copier/printers might use for "A4 rotated", or in other words, A4 paper in landscape orientation. – telcoM Dec 14 '18 at 8:36
  • @dirkt Hi, please see my EDITs. – SebMa Dec 17 '18 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.