Offending Command error while Printing EPS - printing

I am printing an EPS File generated with following credentials.
%-12345X#PJL JOB
#PJL ENTER LANGUAGE = POSTSCRIPT
%!PS-Adobe-3.0
%%Title: InvoiceDetail_combine
%%Creator: PScript5.dll Version 5.2.2
%%CreationDate: 10/7/2011 4:46:59
%%For: Administrator
%%BoundingBox: (atend)
%%Pages: (atend)
%%Orientation: Portrait
%%PageOrder: Special
%%DocumentNeededResources: (atend)
%%DocumentSuppliedResources: (atend)
%%DocumentData: Clean7Bit
%%TargetDevice: (HP Color LaserJet 4500) (2014.200) 0
%%LanguageLevel: 2
%%EndComments
While doing Selection Printing on Ricoh Afficio 2090 or any other drivers/printers get the following error printed on the sheets
ERROR: undefined
OFFENDING COMMAND: F4S47
Stack:
.
Kindly Review and suggest a turn around for the same as i am already stuck in this hell. I have tried to convert/extract in PS but all in vain. I am using gsview to Print and view these files.

This is the problem:
%%PageOrder: Special
A ps document with "Special" page order can NOT be re-ordered. You cannot do a selection or range with this file because it is broken for this use. You must reprocess the file using Distiller or ghostscript (ps2ps or ps2pdf) in order to print selected or re-ordered pages from the document.
You can avoid this by generating your postscript files with a real Postscript™ driver (one not created by Microsoft).
The GSView Documentation has more about this.
Previously:
This line ...
%%TargetDevice: (HP Color LaserJet 4500) (2014.200) 0
... tells us that the file was generated with HP printers as a target. So this really is not an EPS file. Because it's not Encapsulatable. To generate output on a printer the file has to execute the showpage operator, which is a no-no for EPS files.
So uncheck the EPS box (it's a big fat lie, anyway), and select (install) a Generic Postscript driver. If you need to send it to multiple makes of printer, the file needs to make as few assumptions about the printer as possible.

The first thing is that this is not a valid EPS file, as it has PJL attached at the front. Many PostScript printers will strip this off, but by no means all.
This probably is not the source of the problem.
There is no way to 'review' the problem as you have not supplied the complete PostScript program. Without that there is no way to tell what is actually wrong, the error message tells you that the interpreter encountered 'F4547' while trying to parse a token, and that this has not been defined as a routine.
Most likely the file is corrupt, either damaged in some way, or possibly it is a biinary file and has been transmitted by some process which does has done some kind of conversion (CR/LF is common). The offending command looks like its ASCIIHex encoded, so that may be a red herring.
If you want additional help, you are going to have to make the whole program available somewhere.

Related

How to set font in Texinfo

I'm using the GNU texinfo package to generate both PDF and .info files from a .texi file.
I'm trying to update an old .texi file (not changed since 2001) and generate the same PDF output. I've resolved a number of issues, but there are a couple outstanding. In the old PDF, the title was in Helvetica and body text is Liberation Serif. In the new PDF, both are Computer Modern.
I've read everything that I can find about fonts, but I'm not able to change the fonts. Nothing that I do seems to work. Everything I have tried generates errors.
In my .texi file, before any \setfont directives, I have \def\fontprefix{uh} which, if I read the pdftex.map file correctly, should select the NimbusSanL font set (e.g. uhvr8a.pfb). I get the following errors:
mktexnam: Could not map source abbreviation for uhss10.
kpathsea: Running mktexmf uhss10
! I can't find file uhss10'.
<*> ...ljfour; mag:=1; ; nonstopmode; input uhss10`
Does anyone have a example .texi file which sets the font family to use? Or an explanation of what I'm doing wrong?

I couldn't open style file IEEEbib.bst

I am trying to complete a paper in latex downloaded from an online template.
there shows an error while compiling:
This is BibTeX, Version 0.99d (MiKTeX 21.6)
The top-level auxiliary file: Islam2021.aux
I couldn't open style file IEEEbib.bst
---line 69 of file Islam2021.aux
: \bibstyle{IEEEbib
: }
I'm skipping whatever remains of this command
I found no style file---while reading file Islam2021.aux
(There were 2 error messages)
Process exited with error(s)
How can I fix this?
IEEEbib.bst is not a default style include in tex distributions. Either you can download it from wherever you have your online template from or you could try your luck with a random version of the file from somewhere on the internet, e.g.
https://2021.ieeeicassp.org/Papers/PaperFormat/IEEEbib.bst
(this might be a different version and might give different results ...)

Chinese fonts in English Document of Latex

I would like to ask how to write some Chinese characters (simplified) within an English Latex document? I followed some methods suggested online but none of them are working for me. I am using Texworks to compile my document (pdfLatex).
\usepackage{CJKutf8}
\documentclass{article}
\usepackage{CJKutf8}
\begin{document}
\begin{CJK}{UTF8}{bsmi}
你好吗
\end{CJK}
\end{document}
another method is mentioned here,
\usepackage{CJKutf8}
\newcommand{\zh}[1]{\begin{CJK}{UTF8}{gbsn}#1\end{CJK}}
insert whatever Chinese characters you like into the document by typing
\zh{中文}
The error I receive is as following when using the method of CJKutf8 with pdfLaTeX mentioned here,
The log file hopefully contains the information to get MiKTeX going again:
C:\Users\muhd_\AppData\Local\MiKTeX\2.9\miktex\log\miktex-makepk.log
)
!pdfTeX error: miktex-pdftex.exe (file bsmiu30): Font bsmiu30 at 600 not found
==> Fatal error occurred, no output PDF file produced!
Log file is attached here.
The first error in the log file
The process terminated due to an access violation.
suggests that there are some problems with permissions while trying to create the necessary files to use the font for the Chinese letters.
Based on this answer https://tex.stackexchange.com/a/419809/36296 the problem can be fixed by either runing updmap from the command line or Refresh font map files from within the miktex console (in user mode).

Why does the search results change after PDF optimization in Ghostscript?

When searching for the word find in the PDF file in this Link before Ghostscript optimization the results will give pages number 4,7 and 13 but after the optimization it gives only pages 4 and 13 ignoring page number 7, the script im using for the optimization :
D:/gswin64c -sDEVICE=pdfwrite -dMaxSubsetPct=100 -dAutoRotatePages=/None -dMaxInlineImageSize=0 -dPDFSETTINGS=/ebook -dColorImageResolution=96 -dDetectDuplicateImages=true -dColorImageDownsampleThreshold=1.1 -dDOPDFMARKS -dUseTrimBox -sOutputFile="D:/temp/search_text.pdf" -dNOPAUSE -dNOGC -dBATCH -dNumRenderingThreads=8 -c 50000000 setvmthreshold -f "D:/temp/iphone_user_guide.pdf"
I've tried to add several fonts related parameters to the script such as -dEmbedAllFonts=true and pointing to fonts path also I've tried to play with the parameters by eliminating some but with no result
what could be the cause of this problem?
Ghostscript doesn't do 'optimization'. See my answer here:
GhostScript issues with a CropBox
for some details on what it does do.
Wihtout seeing your file I cannot tell you for certain what the difference is, but most likely the missing text has been drawn as images instead of text for some reason.
By the way, a lot of the options you are sending have absolutely no effect (eg NumRenderingThreads, for a device which doesn't do rendering). You should NOT select -dNOGC, that's a really bad idea, -dDOPDFMARKS is already set for the pdfwrite device.

What do I need to put in .emacs to print to default Windows printer?

I used to have postcript printing working perfectly in Emacs 21 in Windows+Cygwin, but after upgrading to Emacs 23, I am receiving the following error in the minibuffer:
Opening output file: invalid argument, C:/PDFCreator:
My current .emacs contain the current relevant statements:
(require 'ps-print)
(setq ps-spool-duplex t)
(setq ps-auto-font-detect nil)
(setq ps-print-color-p nil)
It used to have the following line as well:
(setq ps-lpr-command "qprt")
But it generates a similar error:
Searching for program: no such file or directory, qprt
Any idea what changed in Emacs 23 and how I can bring printing back to life?
(at this point I am only interested in printing to the default Windows printer, which is PDFCreator).
From the Emacs Wiki PrintingFromEmacs, the following configuration is recommended.
Where lpr is the Cygwin lpr version.
(setenv "PRINTER" "PDFCreator")
(cond ((eq system-type 'windows-nt)
(setq ps-printer-name "PDFCreator")
(setq ps-printer-name-option "-d")
(setq ps-lpr-command "/bin/lpr")))
You could also use the Ghostscript configuration there and select the PDFCreator printer from the popup. Adjusting your GS_LIB and your ghostscript binary location accordingly.
(setenv "GS_LIB" "e:/tools/GSTools/gs8.14/gs8.14/lib;e:/tools/GSTools/gs8.14/fonts")
(setq ps-lpr-command "e:/tools/GSTools/gs8.14/gs8.14/bin/gswin32c.exe")
(setq ps-lpr-switches '("-q" "-dNOPAUSE" "-dBATCH" "-sDEVICE=mswinpr2"))
(setq ps-printer-name t)
Note to users of PDFCreator - they now install a bunch of toolbars and take over your web browsers when you install it.
http://en.wikipedia.org/wiki/Pdfcreator#Adware_toolbar_controversy
I had PDFCreator working fine with Emacs, then I made the mistake of letting PDFCreator update itself. It redirected all my search queries to Bing, took over a bunch of browser settings, added toolbars, default landing pages etc. It took me about an hour to clean out all the junk it added.
I had the same symtom as the poster, but it wasn't because of any change in Emacs 23.
My printer is a postscript capable network printer.
First, my hostname had changed sligtly when my work computer was upgraded from Windows to Vista. I had to change one character accordingly:
From
(setq ps-printer-name "//evf4ce46ac4ad3/seki81050470cm")
to
(setq ps-printer-name "//e7f4ce46ac4ad3/seki81050470cm")
This changed the error message from
direct-print-region-helper: Opening output file: invalid argument, //evf4ce46ac4ad3/seki81050470cm
to
direct-print-region-helper: Opening output file: no such file or directory, //e7f4ce46ac4ad3/seki81050470cm
Then I had to enable sharing of the printer. This is found in
\\e7f4ce46ac4ad3\Printers
which probably can be found in a more generic way. \\%computername%\Printers didn't work for me; I don't know why.
Right-click on the printer icon, select Sharing and enable Share this printer, with a suitable printer name, preferably with no spaces in it.
This was enough to enable printing for me.

Resources