ZFOLD/TRIFOLD Attribute In PCL Print Job

I am looking for a way to set the "@PJL COMMENT EFIPJL SET ZFOLD" parameter in a print job generated by Java's Print API, in order to tri-fold the paper in a Minolta printer.
I am using the PrintRequestAttributeSet to set Sides.DUPLEX and have checked all the Finishings options available. When printing to disc, the following PJL commands are automatically inserted at the top of the PCL file:
%-12345X@PJL SET PAGEPROTECT=AUTO
@PJL COMMENT EFIPJL SET MEDIATYPE=MEDTYPEPAPER
@PJL SET COPIES=1
@PJL COMMENT EFIPJL SET SORTERMODE=GENERICON
@PJL SET DUPLEX=ON
@PJL COMMENT EFIPJL SET STAPLE=GENERICOFF
@PJL COMMENT EFIPJL SET PUNCH=GENERICOFF
@PJL COMMENT EFIPJL SET ZFOLD=GENERICOFF
@PJL SET RESOLUTION=600
@PJL ENTER LANGUAGE=PCLIf I edit the PCL file and change ZFOLD to TRIFOLD, then send the PCL file to the printer using the lp command (under Linux), it prints duplex and tri-folds. Does anyone know how to set the ZFOLD parameter programmatically in Java?
Thanks in advance.

Unfortunately not. I had already tried it but it doesn't work.
I am not sure about whether the following function is called in this case, but it seems as if the job name is hard coded (function is taken from Java-sources):
JNIEXPORT jboolean JNICALL
Java_sun_print_Win32PrintJob_startPrintRawData(JNIEnv *env,
                           jobject peer,
                           jstring printer)
  HANDLE      hPrinter;
  DOC_INFO_1  DocInfo;
  LPTSTR printerName = (LPTSTR)JNU_GetStringPlatformChars(env, printer, NULL);
  // Start by opening the printer
  if (!::OpenPrinter(printerName, &hPrinter, NULL)) {
    JNU_ReleaseStringPlatformChars(env, printer, printerName);
    return false;
  JNU_ReleaseStringPlatformChars(env, printer, printerName);
  // Fill in the structure with info about this "document."
  DocInfo.pDocName = TEXT("My Document");
  DocInfo.pOutputFile = NULL;
  DocInfo.pDatatype = TEXT("RAW");
  // Inform the spooler the document is beginning.
  if( (::StartDocPrinter(hPrinter, 1, (LPBYTE)&DocInfo)) == 0 ) {
    ::ClosePrinter( hPrinter );
    return false;
  // Start a page.
  if( ! ::StartPagePrinter( hPrinter ) ) {
    ::EndDocPrinter( hPrinter );
    ::ClosePrinter( hPrinter );
    return false;
  // store handle
  jfieldID fieldId = getIdOfLongField(env, peer, HPRINTER_STR);
  env->SetLongField(peer, fieldId, reinterpret_cast<jlong>(hPrinter));
  return true;
}

Similar Messages

  • I need help.  Can LiveCycle PDF Generator accept network print jobs from a PCL only source?

    I need help.  Can LiveCycle PDF Generator accept network print jobs from a PCL only source?

    More information about this game:
    The game should generate a random obstacle course for the player. The first column of the grid, however, should consist of all empty pieces, with the exception of the upper left-hand corner, which is the grid location where the player initially resides.
    Enter a loop in which the following things happen (not necessarily in this order):
    Print the current board configuration. Additionally, a key should be printed describing what each piece is.
    Get an action from the user. The player can move up, down, left, or right. Use the following controls: up = 'i', down = 'm', left = 'j', right = 'k'. The player can move at most one block at a time. Of course, if the player tries to move into a spot occupied by an immovable block, the player will not move.
    Inform the player whether they have won, or if they have lost (a player loses if they step on a bomb piece).
    If the player types 'q', the game should terminate.
    I am still stuck on this maze generator stuff.... Please help me....

  • P3005 error message PCL XL error IllegalMediaSource extra sheet printed after every print job

    We have a networked P3005 with a stepped back PCL5e driver working for three Word 2003 people and one Word 2007 person. Out of the blue the Word 2007 person began getting an extra sheet of paper after every print job with the error message PCL XL error  Warning: IllegalMediaSource. We had gotten a version of this error before, which is why I stepped back the driver to PCL5e.
    Anyone have any thoughts? Please??

    I have not had any problems since I read a post from someone to turn the printer off unplug the power cord from it and wait a little bit.  Plugged it back in, turned it on and it has been working.   I am using Vista 32 bit.  I'm not sure this is what you are wanting on the driver.  I found this  HPC14106 .GPD    3.25.2010
    Thanks

  • Cannot print Landscape report to PCL printer - Solved

    Has anyone been able to print a landscape BIP PDF to a PCL printer?
    I am on EBS 11.5.10.2, with BIP 5.6.3, and PASTA 3.0.4.
    The first report template I tried creating (Discrete Job Pick List Report) in XML Publisher / BIP happens to have a landscape layout, 11 inches wide by 8.5 inches high.
    The report is created successfully as a PDF, but I can't get that PDF to print successfully on my PCL printers - the output is truncated on the right. It looks like it is trying to print the landscape report on portrait paper.
    Not sure if that makes sense. It is not rotating the report contents to fit on the paper.
    I configured PASTA as instructed in MetaLink:
    Note 338990.1 - How To Print XML Publisher PDF Reports Via The Concurrent Manager,
    Note 356501.1 - How to Setup Pasta Quickly and Effectively, and
    Note 365111.1 - How to Setup Pasta for PCL Base Printers
    I submitted a TAR/SR on this and they referred me to
    Note 421358.1 - Custom Landscape Reports In PDF Format Print in Portrain Orientation
    And basically told me what I was trying to do was not normal, and that I should get a PostScript printer. That's not an option, since all of our printers do PCL, but not all of them do PS.
    Has anyone been able to achieve this?
    Thanks,
    Steve
    Edited by: user650442 on Oct 8, 2008 11:55 AM
    (changed original subject to add 'Solved')

    The SR conversation on this topic ended with "EBS does not have any seeded code or driver that can covert a PDF file to PCL, however. If such a third party tools exists, it can be placed (called) within the preprocessing section of the pasta_pdf.cfg configuration file." The documentation recommends "acroread", but I think this is an obsolete utility, plus it doesn't do PCL.
    I could not find a third party tool to convert to PCL in the preprocess section of PASTA, while doing landscape, but I did find a third party tool that can replace the "ntPrintCommand" part of PASTA. It is called "GSPRINT", and it is part of GSview. I am on a Windows platform, so this is perfect for me, since it works with the Windows printer drivers at a bitmap level, and no PCL or PostScript conversion or preprocessing is necessary on my part. It takes the PDF as input directly, and prints it.
    Here is the essence of my pasta.cfg file now (named pasta_gsprint_landscape.cfg)
      outputFormat=text
      ntPrintCommand=c:\utils\gs\gsview\gsprint.exe -printer "{printername}" -landscapeThe outputFormat=text so that PASTA will not do anything except preprocess and print. I took out the preprocess, so all it does is print using gsprint.
    Since this makes pasta pretty much just overhead, I'm going to look into the option of running gsprint directly and taking pasta out of the loop completely.

  • Unable to specify printer for print jobs in Java7 for OSX

    Hi, I'm developing a simple software that would monitor a folder for new documents and print them automatically. Monitoring the folder was the easy part with WatchService in Java7, but I'm running into problems with printing. Namely, I'm using java.awt.print.PrinterJob to print the document, but the print job is always sent to the default printer, instead of the printer that was specified.
    PrinterJob pPrinterJob = PrinterJob.getPrinterJob();
    PrintService[] psArr = PrinterJob.lookupPrintServices();
    for (PrintService ps : psArr) {
    if (ps.getName().equalsIgnoreCase(specifiedPrinterName)) {
    pPrinterJob.setPrintService(ps);
    break;
    PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
    //specify print attributes....
    pPrinterJob.print(pras);
    The code looks simple enough, and calling getPrinterService() returns the intended printer after specifying it using setPrinterService(). However, regardless of the printer specified, the print job is still sent to the default printer. Tried on both Java 7 Update 4 and Update 6 for OSX with the same result.
    Update: Got my hands on a Win XP machine and tried out the same piece of code using Java 7 Update 6 for Windows. Guess what, the print job was sent to the specified printer! I'm pretty sure this is an OSX specific issue now. Has anyone come across this issue previously?

    Hi,
    I have the exact same problem on OS X 10.8.2 with Java 1.7.0 Update 21.
    When I call PrintServiceLookup.lookupPrintServices(null, null) I get three distinct printers, but no matter which of the three I specify, the print job is sent to the default printer.
    The code works as expected when tested on Windows and Linux machines.
    Any help is appreciated!

  • Why does my Laserjet 2055dn only print the first page of a print job?

    In our domain, we have a number of 2055dn printers that act up on intermittent bases.  At times, they function properly, but other times they will only print the first page of a print job.  Our domain has only HP printers so there should be no conflict with drivers.  My solution has been to delete the printer on the local machine and then to reinstall them after reboot.  That has helped at times.  In other cases, I have installed the printer only on the local machine and not the copy on my printer server.
    I have updated the print drivers, on the server and on the local machines.  I have changed drivers to PS, to PCL 5 and to PCL 6.
    This only seems to occur in one of my three buildings that house this model of printer.  I have even done firmware upgrades on the printers.
    I appreciate any help that I can get on this continuing problem.  Thanks much.

    Then use the latest solution!
    Which doesn't need specifying either.
    Peter

  • Large Print Job Size with Alpha Blending

    A while ago, I wrote some java code to print portions of a graph (from JGraph). In the original design, I painted directly to the Graphics object in the Printable.print method. However, the resulting print job size was around 50MBs per page (which is unacceptable when tens of pages are spooled). Nevertheless, the results were perfect. A second attempt to reduce the print size rendered the output to a BufferedImage before drawing to the Graphics object. The print jobs were now ~500KBs per page, but were pixelated. Because of time constraints we used the latter method.
    Recently, I revisited this problem and discovered the large print size is due to a color using alpha blending. Having transparent pieces is important, but I'd like to improve the print quality. Does anyone know how to "flatten" or otherwise reduce the print size?
    Thanks in advance.

    I've run into this same problem and I can't figure a way around it. I mocked up a simple class to test the difference in sizes of print jobs that are printing a display with translucent colors and those that don't and the difference seems a little extreme. Here's my code:
    import java.awt.*;
    import java.awt.print.*;
    public class SimpleTest implements Printable {
      public static void main(String[] args) {
        PrinterJob job = PrinterJob.getPrinterJob();
        job.setPrintable(new SimpleTest());
        if(job.printDialog()) {
          try {
            job.print();
          catch(Exception e) {
            e.printStackTrace();
      public int print(Graphics g, PageFormat pf, int pageIndex)
          throws PrinterException {
        if(pageIndex >= 10) {
          return Printable.NO_SUCH_PAGE;
        g.setColor(new Color(0f, 1f, 0f, 0.5f));
        g.drawRect(25, 25, 300, 300);
        return Printable.PAGE_EXISTS;
    }On the call to g.setColor, if I set the alpha argument to 1f, the print job size is 64 KB. However, if I set the alpha argument to 0.5f, the print job size bumps up to 239 MB. That's close to 3000x larger!
    So, is there a way around this? I tried changing the PrintQuality and PrinterResolution attributes but neither seemed to have any effect. Maybe I did something wrong? I used the following to change the PrintQuality:
    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
    aset.add(PrintQuality.DRAFT);
    if(job.printDialog(aset)) {Is that the right way to do it? If so, what other options do I have?
    Thanks,
    David

  • XDC - print a empty page after the print job

    Hi Folks,
    i have a problem. i use a xdc file to select multiple trays and after the printing job an additional separator sheet should be "printed" . Its only a empty sheet, which should be at the end of the printjob.
    Could somebody give me a hint? I checked the pcl commands and i got the idea to send a line feed and carriage return command, but im not sure whats happen and if this is possible, could i select the tray for this?
    Thanks a lot for any Idea or Tip,
    kind regards
    Alex

    Wasil, thanks for the response, but i havent found any info to do a separator sheet in this link. I know that i have to do this in the xdc, but i dont know how. I found a plc command to do this, but the problem is that i not understand how to fill this in the xdc.
    Here ist the Part from my XDC File. Ok, its possible that this is at the wrong point, but im sure i have an error in the escaping.
    The Printer i use is a Ricoh MP5002sp. I only found the escaping like i did, but i get a pdf generation error with this part:
       <seq id="postDoc"><ESC/>%-12345X@PJL RDYMSG DISPLAY=""&#13;&#10;<ESC/>H1B\L%-12345X@PJL ENTER LANGUAGE=PCL&#13;&#10;<ESC/>H1B\L&l4H&#13;&#10;<ESC/>H1B\L&l1T\0&#13;&#10;<ESC/>M\B\S\N\U &#13;&#10;<ESC/>U\LJob : \I&#13;&#10;<ESC/>U\LDate: \D&#13;&#10;<ESC/>U\LTime: \T&#13;&#10;<ESC/>E&#13;&#10;</seq>
    The PLC commands i foun on a website looks like this:
    \H1B\L%-12345X@PJL ENTER LANGUAGE=PCL    <-- Puts printer into PCL mode
    \H1B\L&l1H    <-- This command pulls the sep sheet from Tray 2
    \H1B\L&l1T\0    <-- Job Reset. Sets USTATUS counters etc,
    \M\B\S\N\U    <-- Prints user name in large characters
    \U\LJob : \I    <-- Prints spool ID number
    \U\LDate: \D   <-- Prints date
    \U\LTime: \T    <-- Prints time
    \E    <-- Exits banner page and begins actual print job
    But in my case it will be enough to select the tray and "print" the empty sheet...
    thanks a lot for your your help...and it could be a easy task...but it looks like im a "dau" :-)

  • Printer requesting to load legal paper so print job fails

    The printer is a HP Laserjet 4 series PCL-5, device driver: HPLJ4.
    It has 3 trays: #1 is a bypass, #2 and #3 have 8.5x11 paper.
    This printer has been in use for some time, but suddenly the printer is now requesting to "load plain legal" when a print job from SAP originates.  If the user disregards this message and prints anyway then only part of the print job comes out.  If legal paper is loaded, the print job comes out.  But the users do not want it printed to legal, they want the 8.5x11.  I have tried specifying the 'Tray Info' as letter in SPAD.  The printer works just fine for any Windows applications like Microsoft Word, but not with SAP.  Another printer (same brand and device type) does work as expected and the config in SPAD is the same for these 2.  The printer support group says nothing has changed in the config in the printer itself and that the issue has to be on the SAP side. 
    Any feedback on this would be appreciated!

    Since you say another printer of the same brand using the same device type works with the same settings in SPAD I think the problem is with the printer itself.
    This issue comes up occasionally at my site - often after someone prints something out of the ordinary like labels.  Nothing changes in the configuration menu of the printer but the printer asks to load legal when printing from SAP.
    I think there is a lever on the side of the paper trays on HP Laser Jet4's that can be adusted for paper selection.  Have your printer support group compare the paper tray lever settings of the printer that doesn't work out of SAP with one that does.

  • Print job from multiple trays

    I'm a teacher and our school has a Xerox D95/D110/D125 combo. I'm frequently trying to produce packets of printing where the cover page, or maybe pages 5 & 6 of a 12 page packet, are a different color paper. I've tried sending the print jobs down and then assembling the final product on my own, but that always results in human errors. I've tried organizing the paper order before sending the print job, but again - lots of human error.  In both cases I'm spending a ton of time on it. So my question becomes, is it possible to create a packet where (for example) the first page is pulled from tray 1, pages 2-4 are pulled from tray 2, pages 5-10 are pulled from tray 3, and the whole thing hole punched and stapled? Or am I forever relegated to manual collating? Any advice or help would be greatly appreciated.

    The answer seems to be yes, if I understand the question.If you are trying to do a mixed media job and the whole job is stapled together as one.Obviously the exact steps change per job and submission method, and the copier is sold on its own, with a Fiery or with a Freeflow, so the drivers change for each of those. But what you want is either 'Mixed media" or "Special pages" So let's say you have the D95, no RIP and are using the PCL driver (PS is very similar)Anything pertaining to the whole job, and the majority of the paper is done here on tab one. So stapling, the tray of the majority of the paper, folding etc. Son my case all of it is 3 hole punch and 2 sided, and most of the paper is green, and the copier has a tray loaded and programmed with paper set green.  Now I also want pages 7-9 to be blue, and 18-21 to be white, so I go to Document Options > Special Pages > Add Exceptions  A Freeflow will be nearly identical, a Fiery will be different but similar, I don't have a driver for the particular Fiery but they all pretty much are identical, the Media tab has a Mixed Media sub section, what you want is the New Page Range which works exactly the same I can't in the slightest help on a copy job, it is outside my specialty and I have no access to the device in question, but it would be on the last tab for copy jobs <Job Assembly?>, and the option is called a Build Job, but is not nearly as straight forward in my mind. Sorry.  There are things to keep in mind though, the job settings I used above will in fact not work correctly because the job is duplex, so each section would need to start on an odd numbered page and end on an even number. My example would print the pages 1-6 on 3 pieces of green paper , but 7-9 is an issue, because duplex is turned on and than means 2 sheets of Blue paper, so what will the machine do with the back side of the 2nd page? Depending on the job, it could either insert a blank page to fill that spot (This will break the page numbering later and mess up all the other media settings) Or fault the job, or just mess up everything. So not only do you need to know where the page ranges must be, you also need to take into account that duplex means you need to account for physical paper, and digital page numbers.  

  • Enumerate print jobs in queue

    How can you use print.* to enumerate print jobs in the queue? Would anybody have sample code to enumerate print jobs, or there attributes in the print queue?
    Please help me :).
    Brandon

    Annoying cross-posting, once again.
    http://forum.java.sun.com/thread.jspa?threadID=581289&messageID=2950391

  • Cancel all print jobs via command line

    Hi there,
    I'm trying to write a logout hook that cancels all existing print jobs on my client machines.
    From the man pages of lprm I believe it should be:
    lprm -
    But when I run this as root I get the following returned:
    lprm: The printer-uri attribute is required!
    I used to run this using Apple Remote Desktop under 10.4 and it worked fine, it doesn't work now either remotely or as admin on the client itself.
    Have things changed under Leopard?

    Hi
    +*". . . Have things changed under Leopard? . . ."*+
    Absolutely. Did you have any doubts? For example apropos has disappeared yet the man page is still there. Its not the only thing that has disappeared. Clearly nicl had to go because of NetInfo's demise. These are just some of the differences I've found. No doubt there will be others?
    You could look at the man pages for cancel and lp. They appear to be the same thing. Might be up to what you want?
    Tony

  • Printer Job Name

    Hi
    I am trying to change a pcl file so that the printer job name is altered, i can see from the .ics driver file that you can set this to the mdf name and static text only. Has anybody ever had to make a change like this?
    I have the steps in place but the result is not what i expected, i use a perl script and a copy function to send the pcl file to the printer with the new printer job name included.
    The thinking behind this is so that I can see my text on the print spooler and on the physical device, but it is turning out to be a night mare!
    Any help would be appreciated.
    Thanks

    The problem i can see now is that I am trying to replicate the step when the .tmp file which is also the same as the PCL file is processed from the collector directory.
    When it is, it uses the value from the ics file \E%-12345X@PJL\x20RDYMSG\x20DISPLAY="default" the default is the mdf name which is static.
    I use a Perl script and have a copy function to move the changed PCL file to the Printer spool queue, but the job name is now 'Remote DownLevel Document' in stead of the value in the PCL file.
    Any body any idea as how to fix this?
    Thanks

  • Inconvenient printed job results Output ES4

    Hi all,
    I was testing some printing jobs using default XDC that comes with LiveCycle ES4 installation (hppcl5c.xdc, hppcl5e.xdc and hp4350pcl5e.xdc), but i got Inconvenient results when sending the job to print; xml data and logo have been moved into the printed form causing they don't match with the form components as should be at design time. Consulting SAP documentation for Adobe Document Services, it says that there should be XDC files that are shipped for diferent device types like POST2, HPLJ4, HP9500, etc. I'm using a Sharp - MX M264N printer that supports PCL 5e, PCL 6. I have the same design but IFD Form in Adobe Central Output with HPLJ4 selected option as device printer in Presentment Targets and it works fine. ¿Where can i find a XDC library or a HPLJ4 XDC in order to obtain the same result just as in Adobe Central?
    Best regards,

    I did finally find an open bug, # 4527394, that appears to address this issue. I found a solution for the printer that is currently giving me headaches, which is an HP LaserJet 2300d. I turned off the "Enable advanced printing features" setting on the printer's Advanced Properties, and the problem went away. Other applications, such as Adobe Acrobat, are able to print similar documents to the same printer reliably even if "Enable advanced printing features" is enabled, however, so this is really just a workaround, and indicates that Sun's JVM has some fundamental problems in its printing facilities, at least on the Windows platform.
    Kevin Rahe
    KRAHE InfoSystems, Inc.

  • Add stored Job to rear of each print job

    Hi there, I'm looking for thoughts on whether this is possible.
    I'd like to store a simple print job in the printer and using a printer shortcut add it as page 2 of a single page print job I send to the printer.
    The stored job would be our terms and conditions which I would like to print on the rear of the single page/sided invoices I send to the printer.
    I have used workaround solutions such as:-
    1) pre-printing the T&Cs and stacking that in the printer
    2) adding the T&Cs as page 2 in the application and sending a duplex print job
    but am hoping for a more elegant solution using the "stored job" and special pages" features of the print driver.
    Any thoughts?
    Thanks in advance
    Malcolm

    As far as the printer is concerned, 'jobs' are exclusive entities, which means that they can't share the same sheet of paper.
    i.e. when one job is finished, all media (paper) used by the job are flushed from the device before any other job is started.
    What many third-party print products do (and have done for years) is to make use of PCL macros.
    These are normally stored in the printer's RAM (and hence have to be downloaded to the device every time it is powered on), although on some of the more expensive printers, such macros can be loaded more permanently onto a hard disk within the device.
    But the print job you send to the device needs to be able to select the macro(s), which effectively (as far as I'm aware) rules out standard Windows printer drivers.
    i.e. you'd need to write your own print streams (without benefit of a driver), or make use of a third-party product which would do it for you; most such products are designed for particular types of output, and are not suitable for general -purpose printing.

Maybe you are looking for