Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.mac.system > #122883 > unrolled thread

problem in converting text files to PDFs

Started by2014.06.linkinpark@gmail.com
First post2019-03-26 22:32 -0700
Last post2019-03-28 02:47 +0000
Articles 11 on this page of 31 — 9 participants

Back to article view | Back to comp.sys.mac.system


Contents

  problem in converting text files to PDFs 2014.06.linkinpark@gmail.com - 2019-03-26 22:32 -0700
    Re: problem in converting text files to PDFs christian180801@ghanart.org (Christian) - 2019-03-27 08:03 +0100
      Re: problem in converting text files to PDFs "2010.06.LinkinPark" <2014.06.linkinpark@gmail.com> - 2019-03-27 04:58 -0700
        Re: problem in converting text files to PDFs christian180801@ghanart.org (Christian) - 2019-03-27 14:29 +0100
          Re: problem in converting text files to PDFs Jolly Roger <jollyroger@pobox.com> - 2019-03-28 02:55 +0000
            Re: problem in converting text files to PDFs JF Mezei <jfmezei.spamnot@vaxination.ca> - 2019-03-27 23:46 -0400
              Re: problem in converting text files to PDFs Jolly Roger <jollyroger@pobox.com> - 2019-03-28 05:48 +0000
                Re: problem in converting text files to PDFs JF Mezei <jfmezei.spamnot@vaxination.ca> - 2019-03-28 14:52 -0400
                  Re: problem in converting text files to PDFs Jolly Roger <jollyroger@pobox.com> - 2019-03-28 19:07 +0000
                    Re: problem in converting text files to PDFs André G. Isaak <agisaak@gm.invalid> - 2019-03-28 21:20 -0600
              Re: problem in converting text files to PDFs Lewis <g.kreme@gmail.com.dontsendmecopies> - 2019-03-28 13:14 +0000
                Re: problem in converting text files to PDFs JF Mezei <jfmezei.spamnot@vaxination.ca> - 2019-03-28 14:52 -0400
                  Re: problem in converting text files to PDFs Lewis <g.kreme@gmail.com.dontsendmecopies> - 2019-03-28 20:33 +0000
                    Re: problem in converting text files to PDFs JF Mezei <jfmezei.spamnot@vaxination.ca> - 2019-03-28 18:11 -0400
                      Re: problem in converting text files to PDFs Lewis <g.kreme@gmail.com.dontsendmecopies> - 2019-03-29 10:40 +0000
                        Re: problem in converting text files to PDFs JF Mezei <jfmezei.spamnot@vaxination.ca> - 2019-03-29 19:13 -0400
                          Re: problem in converting text files to PDFs Jolly Roger <jollyroger@pobox.com> - 2019-03-30 01:52 +0000
                            Re: problem in converting text files to PDFs JF Mezei <jfmezei.spamnot@vaxination.ca> - 2019-03-30 00:47 -0400
                              Re: problem in converting text files to PDFs Lewis <g.kreme@gmail.com.dontsendmecopies> - 2019-03-30 12:10 +0000
        Re: problem in converting text files to PDFs André G. Isaak <agisaak@gm.invalid> - 2019-03-27 11:21 -0600
    Re: problem in converting text files to PDFs JF Mezei <jfmezei.spamnot@vaxination.ca> - 2019-03-27 15:14 -0400
      Re: problem in converting text files to PDFs 2014.06.linkinpark@gmail.com - 2019-03-27 18:57 -0700
        Re: problem in converting text files to PDFs Jolly Roger <jollyroger@pobox.com> - 2019-03-28 02:37 +0000
          Re: problem in converting text files to PDFs JF Mezei <jfmezei.spamnot@vaxination.ca> - 2019-03-27 23:39 -0400
            Re: problem in converting text files to PDFs christian180801@ghanart.org (Christian) - 2019-03-28 11:46 +0100
            Re: problem in converting text files to PDFs Jolly Roger <jollyroger@pobox.com> - 2019-03-28 15:57 +0000
        Re: problem in converting text files to PDFs dempson@actrix.gen.nz (David Empson) - 2019-03-28 17:56 +1300
          Re: problem in converting text files to PDFs 2014.06.linkinpark@gmail.com - 2019-03-29 20:34 -0700
            Re: problem in converting text files to PDFs Jolly Roger <jollyroger@pobox.com> - 2019-03-30 15:44 +0000
    Re: problem in converting text files to PDFs gtr <xxx@yyy.zzz> - 2019-03-27 13:25 -0700
    Re: problem in converting text files to PDFs Jolly Roger <jollyroger@pobox.com> - 2019-03-28 02:47 +0000

Page 2 of 2 — ← Prev page 1 [2]


#122892

FromJF Mezei <jfmezei.spamnot@vaxination.ca>
Date2019-03-27 15:14 -0400
Message-ID<tYPmE.225650$y65.31770@fx44.iad>
In reply to#122883
On 2019-03-27 01:32, 2014.06.linkinpark@gmail.com wrote:
> I have started giving .txt extensions to many files that I create using vi.   However, when I convert these text files to PDFs (using print to PDF), macOS wraps any lines wider than 70 characters. 


I was going to suggest the command line "textutil" which can convert
from many formats to many formats, but alas, it does not support PDF as
a format.

fmt is one of:  txt, html, rtf, rtfd, doc, docx, wordml,
                                   odt, or webarchive


Hunting a bit more, but i have never tested this:

/System/Library/Printers/Libraries/convert -f <inputfile> -o <outputfile>


Usage: convert [ options ]

Options:

  -e                   Use every filter from the PPD file
  -f filename          Set file to be converted (otherwise stdin)
  -o filename          Set file to be generated (otherwise stdout)
  -i mime/type         Set input MIME type (otherwise auto-typed)
  -j mime/type         Set output MIME type (otherwise application/pdf)
  -P filename.ppd      Set PPD file
  -a 'name=value ...'  Set option(s)
  -U username          Set username for job
  -J title             Set title
  -c copies            Set number of copies
  -u                   Remove the PPD file when finished
  -D                   Remove the input file when finished

[toc] | [prev] | [next] | [standalone]


#122897

From2014.06.linkinpark@gmail.com
Date2019-03-27 18:57 -0700
Message-ID<1e3abdb3-5516-4593-96f2-286bf814d658@googlegroups.com>
In reply to#122892
On Wednesday, March 27, 2019 at 12:14:36 PM UTC-7, JF Mezei wrote:
> On 2019-03-27 01:32, 2014.06.linkinpark wrote:
> > I have started giving .txt extensions to many files that I create using vi.   However, when I convert these text files to PDFs (using print to PDF), macOS wraps any lines wider than 70 characters. 
> 
> 
> I was going to suggest the command line "textutil" which can convert
> from many formats to many formats, but alas, it does not support PDF as
> a format.
> 
> fmt is one of:  txt, html, rtf, rtfd, doc, docx, wordml,
>                                    odt, or webarchive
> 
> 
> Hunting a bit more, but i have never tested this:
> 
> /System/Library/Printers/Libraries/convert -f <inputfile> -o <outputfile>
> 
> 
> Usage: convert [ options ]
> 
> Options:
> 
>   -e                   Use every filter from the PPD file
>   -f filename          Set file to be converted (otherwise stdin)
>   -o filename          Set file to be generated (otherwise stdout)
>   -i mime/type         Set input MIME type (otherwise auto-typed)
>   -j mime/type         Set output MIME type (otherwise application/pdf)
>   -P filename.ppd      Set PPD file
>   -a 'name=value ...'  Set option(s)
>   -U username          Set username for job
>   -J title             Set title
>   -c copies            Set number of copies
>   -u                   Remove the PPD file when finished
>   -D                   Remove the input file when finished

Thanks but you must have an old version of macOS because:

   /System/Library/Printers/Libraries/convert

doesn't exist anymore in 10.14.3 and both

   find /System/Library/Printers -type f -name "*convert*"

and

   which convert

both return zero results.

[toc] | [prev] | [next] | [standalone]


#122898

FromJolly Roger <jollyroger@pobox.com>
Date2019-03-28 02:37 +0000
Message-ID<gg2qaqFfsneU1@mid.individual.net>
In reply to#122897
On 2019-03-28, 2014.06.linkinpark@gmail.com <2014.06.linkinpark@gmail.com> wrote:
> On Wednesday, March 27, 2019 at 12:14:36 PM UTC-7, JF Mezei wrote:
>
> Thanks but you must have an old version of macOS because:

Indeed. JF Mezei perpetually uses old versions of macOS and everything
else and habitually uses bad configurations, then turns around and
blames Apple for the results. His advice should be taken with a big
grain of salt.

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

[toc] | [prev] | [next] | [standalone]


#122902

FromJF Mezei <jfmezei.spamnot@vaxination.ca>
Date2019-03-27 23:39 -0400
Message-ID<vlXmE.545972$tA5.489413@fx47.iad>
In reply to#122898
On 2019-03-27 22:37, Jolly Roger wrote:

> Indeed. JF Mezei perpetually uses old versions of macOS and everything
> else and habitually uses bad configurations, 


I used google. Found out about the "convert" as oarr iof the sytsrtem
livbrary printer stuff. Checked it on my ststem and it existed and gave
me llist of arguments. I have High Sierra. How was I to know that it no
longer existed ?

[toc] | [prev] | [next] | [standalone]


#122909

Fromchristian180801@ghanart.org (Christian)
Date2019-03-28 11:46 +0100
Message-ID<1o55cp1.933w721mf5cj3N%christian180801@ghanart.org>
In reply to#122902
JF Mezei <jfmezei.spamnot@vaxination.ca> wrote:

> I used google. Found out about the "convert" as oarr iof the sytsrtem
> livbrary printer stuff. Checked it on my ststem and it existed and gave
> me llist of arguments. I have High Sierra. How was I to know that it no
> longer existed ?


Mh - see here:
<https://apple.stackexchange.com/questions/335635/where-is-the-convert-command-in-macos>

[toc] | [prev] | [next] | [standalone]


#122911

FromJolly Roger <jollyroger@pobox.com>
Date2019-03-28 15:57 +0000
Message-ID<gg497uFps2vU1@mid.individual.net>
In reply to#122902
JF Mezei <jfmezei.spamnot@vaxination.ca> wrote:
> On 2019-03-27 22:37, Jolly Roger wrote:
> 
>> Indeed. JF Mezei perpetually uses old versions of macOS and everything
>> else and habitually uses bad configurations, 
> 
> I used google. Found out about the "convert" as oarr iof the sytsrtem
> livbrary printer stuff. Checked it on my ststem and it existed and gave
> me llist of arguments. I have High Sierra. How was I to know that it no
> longer existed ?

And here you have it from the horse’s mouth. Take everything this doofus
says with a huge grain of salt.


-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

[toc] | [prev] | [next] | [standalone]


#122904

Fromdempson@actrix.gen.nz (David Empson)
Date2019-03-28 17:56 +1300
Message-ID<1o55skq.fdx6ipexs35xN%dempson@actrix.gen.nz>
In reply to#122897
<2014.06.linkinpark@gmail.com> wrote:

> On Wednesday, March 27, 2019 at 12:14:36 PM UTC-7, JF Mezei wrote:
> > On 2019-03-27 01:32, 2014.06.linkinpark wrote:
> > > I have started giving .txt extensions to many files that I create
> > > using vi.   However, when I convert these text files to PDFs (using
> > > print to PDF), macOS wraps any lines wider than 70 characters.
> > 
> > Hunting a bit more, but i have never tested this:
> > 
> > /System/Library/Printers/Libraries/convert -f <inputfile> -o <outputfile>
> > 
> > 
> > Usage: convert [ options ]
> > 
> > Options:
> > 
> >   -e                   Use every filter from the PPD file
> >   -f filename          Set file to be converted (otherwise stdin)
> >   -o filename          Set file to be generated (otherwise stdout)
> >   -i mime/type         Set input MIME type (otherwise auto-typed)
> >   -j mime/type         Set output MIME type (otherwise application/pdf)
> >   -P filename.ppd      Set PPD file
> >   -a 'name=value ...'  Set option(s)
> >   -U username          Set username for job
> >   -J title             Set title
> >   -c copies            Set number of copies
> >   -u                   Remove the PPD file when finished
> >   -D                   Remove the input file when finished
> 
> Thanks but you must have an old version of macOS because:
> 
>    /System/Library/Printers/Libraries/convert
> 
> doesn't exist anymore in 10.14.3 and both
> 
>    find /System/Library/Printers -type f -name "*convert*"
> 
> and
> 
>    which convert
> 
> both return zero results.

It appears that JF Mezei has found an unsupported or obsolete feature.

/System/Library/Printers/Libraries/convert doesn't exist on a fresh
install of OS X 10.8 Mountain Lion or later. It was standard in earlier
versions at least as far back as Mac OS X 10.5 Leopard (I don't have
anything older handy at the moment so can't check them).

That convert utility might still exist on some 10.8 and later systems if
they were upgraded/migrated from a system that was originally running
10.7 or earlier, but based on it being missing on my 10.14.3 system it
was probably excluded at some point.

In any case, that particular 'convert' file is just a symbolic link to
/usr/sbin/cupsfilter, so you can do exactly the same thing by using the
cupsfilter command instead. It is even on the default path, so no need
to muck around with a long path to the utility. It exists on 10.14 and
has a man page.

man cupsfilter

A brief usage summary (same as shown in the quotes above) is displayed
by running cupsfilter with no arguments.

cupsfilter

Working out how to use it is left as an exercise for the reader. I
haven't played with it.

-- 
David Empson
dempson@actrix.gen.nz

[toc] | [prev] | [next] | [standalone]


#122928

From2014.06.linkinpark@gmail.com
Date2019-03-29 20:34 -0700
Message-ID<0a147c03-dd3a-4bd5-a074-a51971abaeb5@googlegroups.com>
In reply to#122904
On Wednesday, March 27, 2019 at 9:56:38 PM UTC-7, David Empson wrote:
> <2014.06.linkinpark> wrote:
> 
> > On Wednesday, March 27, 2019 at 12:14:36 PM UTC-7, JF Mezei wrote:
> > > On 2019-03-27 01:32, 2014.06.linkinpark wrote:
> > > > I have started giving .txt extensions to many files that I create
> > > > using vi.   However, when I convert these text files to PDFs (using
> > > > print to PDF), macOS wraps any lines wider than 70 characters.
> > > 
> > > Hunting a bit more, but i have never tested this:
> > > 
> > > /System/Library/Printers/Libraries/convert -f <inputfile> -o <outputfile>
> > > 
> > > 
> > > Usage: convert [ options ]
> > > 
> > > Options:
> > > 
> > >   -e                   Use every filter from the PPD file
> > >   -f filename          Set file to be converted (otherwise stdin)
> > >   -o filename          Set file to be generated (otherwise stdout)
> > >   -i mime/type         Set input MIME type (otherwise auto-typed)
> > >   -j mime/type         Set output MIME type (otherwise application/pdf)
> > >   -P filename.ppd      Set PPD file
> > >   -a 'name=value ...'  Set option(s)
> > >   -U username          Set username for job
> > >   -J title             Set title
> > >   -c copies            Set number of copies
> > >   -u                   Remove the PPD file when finished
> > >   -D                   Remove the input file when finished
> > 
> > Thanks but you must have an old version of macOS because:
> > 
> >    /System/Library/Printers/Libraries/convert
> > 
> > doesn't exist anymore in 10.14.3 and both
> > 
> >    find /System/Library/Printers -type f -name "*convert*"
> > 
> > and
> > 
> >    which convert
> > 
> > both return zero results.
> 
> It appears that JF Mezei has found an unsupported or obsolete feature.
> 
> /System/Library/Printers/Libraries/convert doesn't exist on a fresh
> install of OS X 10.8 Mountain Lion or later. It was standard in earlier
> versions at least as far back as Mac OS X 10.5 Leopard (I don't have
> anything older handy at the moment so can't check them).
> 
> That convert utility might still exist on some 10.8 and later systems if
> they were upgraded/migrated from a system that was originally running
> 10.7 or earlier, but based on it being missing on my 10.14.3 system it
> was probably excluded at some point.
> 
> In any case, that particular 'convert' file is just a symbolic link to
> /usr/sbin/cupsfilter, so you can do exactly the same thing by using the
> cupsfilter command instead. It is even on the default path, so no need
> to muck around with a long path to the utility. It exists on 10.14 and
> has a man page.
> 
> man cupsfilter
> 
> A brief usage summary (same as shown in the quotes above) is displayed
> by running cupsfilter with no arguments.
> 
> cupsfilter
> 
> Working out how to use it is left as an exercise for the reader. I
> haven't played with it.
> 
> -- 
> David Empson
> dempson@actrix.gen.nz

Perfect!

This is the command I used which did not wrap the lines!

   cupsfilter myfile.txt > myfile.pdf 2> /dev/null

Thanks, David!  I am so appreciative.

[toc] | [prev] | [next] | [standalone]


#122935

FromJolly Roger <jollyroger@pobox.com>
Date2019-03-30 15:44 +0000
Message-ID<gg9h65Fu6h1U3@mid.individual.net>
In reply to#122928
On 2019-03-30, 2014.06.linkinpark@gmail.com <2014.06.linkinpark@gmail.com> wrote:
> On Wednesday, March 27, 2019 at 9:56:38 PM UTC-7, David Empson wrote:
>> 
>> In any case, that particular 'convert' file is just a symbolic link to
>> /usr/sbin/cupsfilter, so you can do exactly the same thing by using the
>> cupsfilter command instead. It is even on the default path, so no need
>> to muck around with a long path to the utility. It exists on 10.14 and
>> has a man page.
>> 
>> man cupsfilter
>> 
>> A brief usage summary (same as shown in the quotes above) is displayed
>> by running cupsfilter with no arguments.
>> 
>> cupsfilter
>> 
>> Working out how to use it is left as an exercise for the reader. I
>> haven't played with it.
>> 
> Perfect!
>
> This is the command I used which did not wrap the lines!
>
>    cupsfilter myfile.txt > myfile.pdf 2> /dev/null
>
> Thanks, David!  I am so appreciative.

Nah. It still wraps long lines - apparently at 80 characters:

<https://jmp.sh/HpaL5Lj>

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

[toc] | [prev] | [next] | [standalone]


#122893

Fromgtr <xxx@yyy.zzz>
Date2019-03-27 13:25 -0700
Message-ID<q7gm8n$3vq$1@news.albasani.net>
In reply to#122883
On 2019-03-27 05:32:36 +0000, 2014.06.linkinpark@gmail.com said:

> I have started giving .txt extensions to many files that I create using 
> vi.   However, when I convert these text files to PDFs (using print to 
> PDF), macOS wraps any lines wider than 70 characters.   Is there a way 
> to prevent this and make the PDF accept lines of 80 characters without 
> wrapping the lines?
> 
> Also, it would be nice to move such PDFs to my iPhone XS and be able to 
> view the PDF ... at least with the iPhone turned on its side ... 
> without wrapping occurring.  Or is this just not possible due to the 
> width of the iPhone?
> 
> Thanks for any help.

Back during my years in the mines, I remember vi having a distinction 
between line-feed/carriage return relative to other text programs, such 
as textedit.

This may not be to your advantage, but I'd recommend opening the file 
with Pages.  Use View > Show Invisibles to see what kind of irritations 
vi has left in the text.  Replace them as necessary, print to pdf from 
Pages.

How to view them?  Are you using iCloud.  If so you can copy/move them 
to your iCloud drive and access them via your phone that way.  I view 
such files on i-devices using DevonThink, which is certainly more than 
you need.

[toc] | [prev] | [next] | [standalone]


#122899

FromJolly Roger <jollyroger@pobox.com>
Date2019-03-28 02:47 +0000
Message-ID<gg2qtfFfsneU2@mid.individual.net>
In reply to#122883
On 2019-03-27, 2014.06.linkinpark@gmail.com <2014.06.linkinpark@gmail.com> wrote:
> I have started giving .txt extensions to many files that I create
> using vi.   However, when I convert these text files to PDFs (using
> print to PDF), macOS wraps any lines wider than 70 characters.

In what application did you use the print to PDF function?  What font
face and size was being used by that application to display the text?
What paper size did you choose in File > Page Setup before printing?
Such etails matter.

> Is there a way to prevent this and make the PDF accept lines of 80
> characters without wrapping the lines?

Print the document with the proper font size, page size, and so on. PDF
documents mimic what you see on paper. If you don't want lines to wrap
as they would necessarily on a piece of paper, PDF probably isn't the
best medium choice. Perhaps you should keep them in plain text.

> Also, it would be nice to move such PDFs to my iPhone XS and be able
> to view the PDF ... at least with the iPhone turned on its side ...
> without wrapping occurring.  Or is this just not possible due to the
> width of the iPhone?

You can view plain text files on iOS (for instance by dropping a text
file into iCloud Drive on a Mac, then reading it in the Files app on
iOS), but it's only natural that longer lines will be wrapped so you
aren't stuck scrolling around just to read them.

Can you explain *why* line wrapping is not desired?

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.sys.mac.system


csiph-web