[cups] My printer prints only in "portait" mode instead of "landscape" mode for an A4 format PDF file

YuGiOhJCJ Mailing-List yugiohjcj-mailinglist at laposte.net
Tue Aug 19 16:27:43 PDT 2014


> > > Hello,
> > >
> > > My printer (Dell B1260dn Mono Laser Printer) prints only in  
> > > "portait" mode instead of "landscape" mode for an A4 format PDF fil  
> > > [1].
> > >
> > > My command to print is:
> > > $ lp tmp/example-image-a4-landscape.pdf
> > >
> > > You can find the log here:
> > > http://pastebin.com/FBCHDSbe
> > >
> > > On LibreOffice, I have found a way to solve this problem:
> > > https://bugs.freedesktop.org/show_bug.cgi?id=44664#c4
> > >
> > > But from command line, I have not found a workaround.
> > >
> > > Do you know what to do?
> > >
> > > Thank you.
> > > Best regards.
> > >
> > > [1] http://mirror.hmc.edu/ctan/macros/latex/contrib/mwe/example-image-a4-landscape.pdf
> 
> > Make sure you have a sufficiently recent version of cups-filters.
> > I just tested your PDF on Peppermint-Three-Linux (cups 1.5.3, cups- 
> > filters 1.0.18) and it printed OK.
> > 
> 
> I have cups-1.5.4 installed on my Slackware 14.1.
> So, the same version you have.
> I think Slackware 14.1 does not include cups-filters because I cannot find this package.
> 
> To upgrade from cups-1.5.4 to cups-1.7.5, I do:
> $ ./configure --prefix=/usr
> $ make
> $ make install BUILDROOT=/tmp/cups-1.7.5
> Then I build and install the package.
> But when I try to print with this last version of cups, I got:
> $ lp tmp/example-image-a4-landscape.pdf
> lp: Unsupported document-format "application/pdf".
> 
> To install cups-filters-1.0.18, I do:
> $ ./configure --prefix=/usr
> $ make
> Using ALL_CFLAGS=-Ifontembed -I.. -I/usr/include/poppler   -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 
> Using CC=gcc
> Using DSOFLAGS=-Wl,-soname,all -shared -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -D_GNU_SOURCE
> Using LDFLAGS=-fPIE -pie -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -D_GNU_SOURCE
> Using LIBS=-lm  -lcupsimage -lcups -Wl,--enable-new-dtags -Wl,-rpath -Wl,/usr/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lgnutls -lgcrypt -lgpg-error -lz -lpthread -lm -lcrypt -lz
> Making all in cupsfilters...
> Linking testcmyk...
> Running CMYK API tests...
> [...]
> Running dither API tests...
> Linking testrgb...
> Running RGB API tests...
> Making all in backend...
> Making all in filter...
> Compiling pdf.cxx...
> pdf.cxx: In function ‘pdf_t* pdf_load_template(const char*)’:
> pdf.cxx:37:25: warning: too many arguments for format [-Wformat-extra-args]
>                  filename);
>                          ^
> pdf.cxx: In function ‘void pdf_resize_page(pdf_t*, int, float, float, float*)’:
> pdf.cxx:267:62: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
>      if (!dict_lookup_rect (&pageobj, "MediaBox", old_mediabox)) {
>                                                               ^
> pdf.cxx:274:56: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
>      dict_set_rect (xref, &pageobj, "MediaBox", mediabox);
>                                                         ^
> pdf.cxx:275:55: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
>      dict_set_rect (xref, &pageobj, "CropBox", mediabox);
>                                                        ^
> pdf.cxx:276:55: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
>      dict_set_rect (xref, &pageobj, "TrimBox", mediabox);
>                                                        ^
> pdf.cxx:277:54: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
>      dict_set_rect (xref, &pageobj, "ArtBox", mediabox);
>                                                       ^
> pdf.cxx:278:56: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
>      dict_set_rect (xref, &pageobj, "BleedBox", mediabox);
>                                                         ^
> pdf.cxx: At global scope:
> pdf.cxx:342:9: error: conflicting return type specified for ‘virtual int NonSeekableFileOutStream::getPos()’
>      int getPos()
>          ^
> In file included from /usr/include/poppler/Object.h:333:0,
>                  from /usr/include/poppler/XRef.h:41,
>                  from /usr/include/poppler/PDFDoc.h:45,
>                  from pdf.cxx:19:
> /usr/include/poppler/Stream.h:264:19: error:   overriding ‘virtual Goffset OutStream::getPos()’
>    virtual Goffset getPos() = 0;
>                    ^
> make[1]: *** [pdf.o] Error 1
> make: *** [all] Error 1
> 
> So, it is a bit hard for me to upgrade my packages.
> 
> Is there a way to know what version of cups-filters I am currently using?

Solved!
It seems that cups-filters is not available on Slackware 14.1 (I don't know exactly why).
In fact, the 'lp: Unsupported document-format "application/pdf"' error message has disappeared when I installed the last cups-filters version (cups-filters-1.0.57).
And now, the "landscape" PDF files are printing correctly in "landscape" mode :)
Remark: cups-filters-1.0.57 depends on qpdf-5.1.2, so don't forget to install it.

That's exactly what I have done to solve my problem:
1) Install cups-1.7.5:
$ ./configure --prefix=/usr
$ make
$ make install BUILDROOT=/tmp/cups-1.7.5
Then build and install the package.
2) Install qpdf-5.1.2:
$ ./configure --prefix=/usr
$ make
$ make install DESTDIR=/tmp/qpdf-5.1.2
Then build and install the package.
3) Install cups-filters-1.0.57:
$ ./configure --prefix=/usr
$ make
$ make install DESTDIR=/tmp/cups-filters-1.0.57
Then build and install the package.
4) Print:
$ lp ~/tmp/example-image-a4-landscape.pdf 
request id is Dell_B1260dn-9 (1 file(s))

Thank you.



More information about the cups mailing list