Discussion:
'padding' a print-file with extra lines
t.clarke
2012-05-04 13:47:42 UTC
Permalink
Hi

Does anyone know of a utility that will convert a print-file containing
form-feeds such that the converted output has no form-feeds but instead
has added blank lines to effectively 'pad' to N lines per 'page'.

This may seem an odd request, but I need to take bog-standard print-files
with variable lines per page (delimited by form-feeds at arbitrary points)
and convert to files that are a multiple of N lines, such that when run through
a txt2pdf converter the resultant pdf pages align with the original source.
Hope that makes sense.......

Tim

--------------------------------------------------------------------------------
This E-Mail (and any files transmitted with it) is intended solely for the use
of the individual or entity to whom it is addressed. If you have received it in
error please notify the sender and delete the message.

Seacon Terminals Ltd, Company No. 1547396, registered in England and Wales
Registered Office: Tower Wharf, Northfleet, Kent, DA11 9BD, England

--
Gllug mailing list - ***@gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
Andy McGarty
2012-05-04 14:14:49 UTC
Permalink
Post by t.clarke
Hi
Does anyone know of a utility that will convert a print-file containing
form-feeds such that the converted output has no form-feeds but instead
has added blank lines to effectively 'pad' to N lines per 'page'.
This may seem an odd request, but I need to take bog-standard print-files
with variable lines per page (delimited by form-feeds at arbitrary points)
and convert to files that are a multiple of N lines, such that when run through
a txt2pdf converter the resultant pdf pages align with the original source.
Hope that makes sense.......
Tim
-
Have you looked at htmldoc? I use it to create customer bills with page
breaks.

Not sure how it would handle just text with no html. Might have to
replace \n with <br> first?
oh and the form feed with |<!-- NEW PAGE -->


|
Fred Youhanaie
2012-05-04 14:44:01 UTC
Permalink
Post by t.clarke
Hi
Does anyone know of a utility that will convert a print-file containing
form-feeds such that the converted output has no form-feeds but instead
has added blank lines to effectively 'pad' to N lines per 'page'.
This may seem an odd request, but I need to take bog-standard print-files
with variable lines per page (delimited by form-feeds at arbitrary points)
and convert to files that are a multiple of N lines, such that when run through
a txt2pdf converter the resultant pdf pages align with the original source.
Hope that makes sense.......
Tim
--------------------------------------------------------------------------------
This E-Mail (and any files transmitted with it) is intended solely for the use
of the individual or entity to whom it is addressed. If you have received it in
error please notify the sender and delete the message.
Seacon Terminals Ltd, Company No. 1547396, registered in England and Wales
Registered Office: Tower Wharf, Northfleet, Kent, DA11 9BD, England
--
http://lists.gllug.org.uk/mailman/listinfo/gllug
The first utility that comes to my mind is "pr", but you will end up with a 3 line header on each page that you will then need to filter out before converting to pdf.

HTH

Fred
--
Gllug mailing list - ***@gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
t.clarke
2012-05-05 07:31:29 UTC
Permalink
Good spot - thanks !
ps with the -t option works nicely, although the reports we produce contain
an initial form-feed character (historical) which results in an initial blank
'page' of 66 lines. However, we already use a print-filter which removes the
initial form-feed on printing (called 'print' below), so that:
print report | pr -t - > output-file
appears to work very nicely

Tim
--
Gllug mailing list - ***@gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug

Loading...