What Format is this File (starting with "!R! SEM 9;EXIT;") and how to display it onscreen

I have the following file found on a customer system and i need to figure out what format it is and (if possible) how to open it in Windows (Win7 or upwards would be perfectly fine).

It sould be some kind of Graphics/Printer format. The filename holds no extencion and it was generated using Windows 95.

File header:

!R! SEM 9;EXIT;
%-12345X@PJL JOB
@PJL SET ECONOMODE=OFF 
@PJL RDYMSG DISPLAY=""
@PJL ENTER LANGUAGE=POSTSCRIPT
M%!PS-Adobe-3.0
%%Title: 
%%Creator: Kyocera Mita FS-1020D KX
%%CreationDate: 10/24/2016 08:45
%%DocumentPrinterRequired: Kyocera Mita FS-1020D KX
%%For: 
%%BoundingBox: (atend)
%%Pages: (atend)
%%Orientation: (atend)
%%PageOrder: Special
%%DocumentNeededResources: (atend)
%%DocumentSuppliedResources: (atend)
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%EndComments
%%BeginDefaults
%%PageOrientation: Portrait
%%PageBoundingBox: 12 10 407 587
%%PageMedia: (Plain)
%%EndDefaults
%%BeginProlog
%%BeginResource: Macro_Basic
/KPDLBASE 100 dict dup begin

It holds more "%%"-Sections, here without content, as it could be sensitive data:

%% Graphics
...
%% Font
...
%% Reencode
...
%% T42
...
end def
%%EndResource
%%EndProlog
%%BeginSetup
KPDLBASE begin
%%BeginFeature: *Resolution 600dpi
BF{
  <</HWResolution [600 600]>> SP
  <</PreRenderingEnhance t>> SP
}EF
%%EndFeature
%%BeginFeature: *InputSlot (Auto Tray Select)
BF{
<</DeferredMediaSelection t>> SP
}EF
%%EndFeature
%%BeginFeature: *PageSize (A5)
BF{
  <</Policies <</PageSize 7>> /PageSize [422 595] /ImagingBBox n>> SP
}EF
%%EndFeature
%%BeginFeature: *MediaType (Automatische Medienauswahl)
BF{
}EF
%%EndFeature
%%BeginFeature: Copies 1
BF{
  <</NumCopies 1>> SP
}EF
%%EndFeature
%%BeginFeature: *Duplex None
BF{
  & ` f setduplexmode E
}EF
%%EndFeature
%%BeginFeature: *Smoothing ON
BF{
  1 & /setdoret g e
}EF
%%EndFeature
%%BeginFeature: *Collate true
BF{
    userdict /UICollateDetails known not {userdict /UICollateDetails 10 # put} if
    userdict /UICollateDetails g @ /Mode 0 put /Hold 0 put
    <</Collate t /CollateDetails UICollateDetails>> SP
}EF
%%EndFeature
  /DTM [0.12000 0.0 0.0 -0.12000 10 587] d
%%EndSetup
KPDLBASE /PageSV save put
%%Page: 1 1
%%PageOrientation: Landscape
%%PageBoundingBox: (atend)
%%BeginPageSetup
  [0.0 0.12000 0.12000 0.0 12 10] + G
%%EndPageSetup

Then it follows ~2500 lines of Content and the following footer:

%%PageTrailer
%%PageBoundingBox: 0 0 574 396
/PageSV where { pop PageSV restore } if
%%Trailer
%%Pages: 1
%%Orientation: Portrait Landscape
%%BoundingBox: 0 0 574 396
%%EOF
%-12345X@PJL EOJ
%-12345X

EDIT:

Here is the code for a C#-console application that trys to convert all files in a given directory to PDF files. Please note that i didnt do any validation on the given input data.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PrintDataToPDF
{
    class Program
    {
        static void Main(string[] args)
        {
        Console.WriteLine("Input filepath:");
        string inputDir = Console.ReadLine();

        DirectoryInfo dir = new DirectoryInfo(inputDir);

        Console.WriteLine("Output filepath:");

        string outputDir = Console.ReadLine();

        List<FileInfo> fileList = new List<FileInfo>();

        foreach (FileInfo item in dir.GetFiles())
        {
            fileList.Add(item);
        }

        Console.WriteLine(fileList.Count + " files found! Convertation is starting..");

        foreach (FileInfo item in fileList)
        {
            string tempname = Path.GetTempFileName();
            using (StreamReader reader = new StreamReader(item.FullName))
            {
                string content = reader.ReadToEnd();
                using (StreamWriter writer = new StreamWriter(tempname))
                {
                    writer.Write(content.Substring(content.IndexOf("%%")));
                }
                Process.Start(@"C:\Program Files\gs\gs9.21\bin\gswin64c.exe", "-o " + outputDir + item.Name + "out.pdf -sDEVICE=pdfwrite "+ tempname);
                Console.WriteLine(item.Name + " was converted!");
            }
        }

        Console.WriteLine("DONE");
        Console.ReadLine();
    }
}
}

!R!SEM6;EXIT; is a command used by kyocera printers and copiers (which probably was the printerdriver used to generate this file).

  • !R! stands for the recognation code for prescribe commands.
  • SEM stands for Set Emulation Mode. this command temporary changes the emulation mode.
  • The 6 means HPIII emulation
  • EXIT ends the execution

The following lines with @PJL indicate a "Print Job Language header".

The M%!PS-Adobe-3.0 indicate that everything else is Postscript code.

You can print this file RAW to a printer but if you want to view it on screen you can take all the Postscript code and convert it to a viewable image.

For instance, you can use Ghostscript to create a PDF. Save all the Postscript code (so everything from %%Title onwards) to a file and execute gs.exe.

gs.exe -o out.pdf -sDEVICE=pdfwrite input-file

Edit: If you have 1500+ files you could use a batch file to convert them. Assuming they are all in one directory, you can do something like this:

Create this convert.cmd somewhere:
Assumes your files are in C:\YOUR_RAW_FILES
Assumes they are all in one directory
Assumes gs is installed in C:\Program Files (x86)\gs\gs9.05\bin\ (change if other version)

@echo off

:: create a convert directory and remove contents
if not exist "C:\MYCONVERTS\" mkdir C:\MYCONVERTS
del /Q C:\MYCONVERTS\*.*

:: loop through all your files and pass the linenumber for %%Title to convert-procedure
for %%X IN (C:\YOUR_RAW_FILES\*.*) do (
  for /f "delims=:" %%a in ('findstr /n "%%Title" %%X') do call :convert %%a %%X %%~nX
)

:: remove the temp files leaving the pdf files in MYCONVERTS
del /Q C:\MYCONVERTS\*.tmp

goto End
::--------------------------------

::================================
:convert
:: we need the lines above %%Title (so - 1)
set /a z=%1 - 1
:: export all remaining lines to .tmp (skipping the first x lines)
for /f "tokens=* skip=%z%" %%b IN ('type %2') DO @echo %%b >> C:\MYCONVERTS\%3.tmp

:: execute ghostscript with correct parameters
"C:\Program Files (x86)\gs\gs9.05\bin\gswin32c.exe" -o C:\MYCONVERTS\%3.pdf -sDEVICE=pdfwrite C:\MYCONVERTS\%3.tmp

goto :eof
::================================

:End

I'm not sure if this will hold up if the files contain real binary information but you can try.