[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: lowriter fails to launch pdf file from cli



On Wed 07 Sep 2022 at 11:32:11 (-0000), Curt wrote:
> On 2022-09-07, jindam, vani <jindam.vani@disroot.org> wrote:
> >>
> >>What's supposed to happen? 
> >
> > Eyal Rozenberg explanation on lo bugzilla 
> > issue (1): The reason is that when you 
> > open a PDF file in LO, regardless of 
> > which app you opened it with - it gets 
> > opened in LO Draw.
> 
> I'm working with an obsolete version (LibreOffice 5.2.7.2) and
> whatever I do, the pdf opens as a raw pdf in the lowriter app (even if I
> open the pdf file directly in lodraw).
> 
> I guess everybody has her own cross to bear.

With bullseye, using a variety of guesses for --infilter
(basically permutating words like in the example here):

$ lowriter --infilter="Writer Office Open PDF" /tmp/version10.pdf

the document does indeed always open in Draw. It shows a
poor rendering of the text in sans serif (the original is
serif). Sporadic interword spaces are turned into overlaps
to make the lines shorter, though they still run over the
Draw margins, and even the edge of the paper. Even some
short lines have unnecesary overlaps.

The document is a mixture of text and music: the drawn
items (staves, barlines, notestems, slurs etc) are rendered
correctly, but noteheads, rests, clefs, etc., which are in
the Emmentaler font, are omitted.

I write all this only because I don't know what LO is meant
to do under the circumstances, either in its Draw or its
Writer manifestation.

I've never seen anything I'd describe as "raw pdf", as in:

  %PDF-1.5
  %....
  3 0 obj
  …

I tried opening lowriter with no file, but Insert→Text from File
produced an error rather than importing anything from the PDF.
Taking the CLI out of the process by File→Open-ing the PDF in Writer,
it just opens it in Draw anyway. I don't see any reference to
Importing, Filtering or Converting in any of the menus in Writer.

BTW I don't think filtering has anything to do with selecting
files from the filesystem (as the OP might have implied): the
nature of a CLI is that you can filter file-types yourself in
a multitude of ways.

> > (1) https://bugs.documentfoundation.org/show_bug.cgi?id=141732
> >
> > The man page says
> >>
> >>   --infilter="<filter>"
> >>                 Force an input filter type if possible.  For example
> >>		 --infilter="Calc  Office  Open  XML"
> >>		 only
> >>
> >>I'm afraid I'm uncertain what that means.

>From reading the reference, and the man page, I would surmise that
it tells LO that this particular XML file is a spreadsheet so that
it opens in Calc rather than Writer/Draw/Impress etc. (Obviously
XMLs have plenty of uses other than Calc spreadsheets.)

For a PDF, I would have thought LO would be able to determine that
for itself (see raw text above), but forcing an input filter could be
useful to control the process of conversion to, say, text (like
pdftotext) or extracting any images (like pdfimages), particularly
where it's counter to what would be natural choice (extracting PDF
text into Writer, and images into Draw).

I do see three files called libpdf{filter,import,ium}lo.so on my system,
but I don't know what they're for. (As a LuaTeX/gnumeric/inkscape person,
LO is just a viewer for the Microsoft documents I sometimes get sent.)

Cheers,
David.


Reply to: