Print scaleType:showAll, generates 2 pages, the correct page and one blank page

Hello,
So I have a the following function:
private function printJobCreator():void{
var printJob:FlexPrintJob=new FlexPrintJob();
printJob.start();
printJob.addObject(printableInvoice, "showAll");
printJob.send(); 
invoiceIndex++;
printAll();
It seems to kind of work. However when it prints, it creates one page that is the right page, and one page that is blank. This isn't going to work for me because I have to run batches of many pages, so having every other page as a blank page isn't an option.
Additionally, my goal was to print multiple pages in one printJob for batch reports. This unfortunately doesn't seem like it is going to work. I was able to make a component that essentially would repeat container.addChild(printableInvoice) for each index in an object, each printableInvoice containing some dynamic concept, however I can't for the life of me get it to print like this.
So the current solution is annoying because for each invoice you have to go through the print dialogue again. Any Ideas? I realized I could do multiple printJob.addObject() calls, but this doesn't work for me because of the blank page issue.... So I either need to solve the blank page issue or generate a UI object that has multiple printableInvoices in it and print that UI object.
Any help?
Joel

This is the flow, I don't see how it could be adding twice. The important stuff happens when the printAll(); function is run.
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.printing.FlexPrintJob;
import mx.rpc.events.ResultEvent;
public var Orders:Object = new Object();
public var printOrders:Array = new Array();
public var postOrder:String="";
public var invoiceIndex:int=0;
private function init():void{
getDataResult.token = orders.getData();
getDataResult.addEventListener(ResultEvent.RESULT, Orders_resultHandler);
private function Orders_resultHandler(event:ResultEvent):void{
Orders = getDataResult.lastResult;
for(var i:int=0; i <= Orders.length-1; i++){
if(Orders[i].print == 0){
printOrders.push(Orders[i]);
postOrder=printOrders[0].orderid;
for(var t:int=1; t <= printOrders.length-1; t++){
postOrder = postOrder + ","+printOrders[t].orderid;
private function orderToShipSorter():void{
private function printAll():void{
if(invoiceIndex <= printOrders.length-1){
printableInvoice.generateInvoice(printOrders[invoiceIndex]);
private function printOrderResult(event:ResultEvent):void{
private function checkLogin(event:ResultEvent):void{
private function printJobCreator():void{
var printJob:FlexPrintJob=new FlexPrintJob();
printJob.start();
printJob.addObject(printableInvoice, "showAll");
printJob.send(); 
invoiceIndex++;
printAll();
protected function printableInvoice_batchGeneratedHandler(event:Event):void
printJobCreator();
]]>
</fx:Script>

Similar Messages

  • I have a large document which keeps repaginating and adding blank pages. I can no longer use the print preview at all. I have tried all the usual fixes. Nothing works. Can anyone help?

    I have a large document which keeps repaginating and adding blank pages. I can no longer use the print preview at all. I have tried all the usual fixes. Nothing works. Can anyone help?

    Is your printer selected? <br />
    Is '''Print to File''' selected, where the web page is being printed to a file and not being sent to your printer?
    See the screenshot below.

  • Hp photosmart 6510 printing and photocopying blank pages even after putting in new ink cardridges

    Hi there, can anyone help?
    My photosmart 6510 has recently started printing and photocopying blank pages.  The ink cardridges were low and I have replaced them with new ones. I have cleaned the printer head and the test comes out in colour.
    I have no idea what to do other than buy a new one !
    Any advice appreciated.

    Hi @TG13,
    I'd like to help. Please begin with the steps in the following document; Printer Prints a Blank Page or Does Not Print Black or Color Ink for the HP Deskjet Ink Advantage an...  < this applies to the 6510, and 6515 too.
    If you complete, or have already completed all of the steps in the document above and the issue continues, my own personal recommendation, not one of HPs, is to use the solution offered in the following video.  I only suggest doing this if the printer is out of warranty; How to fix a HP Printer, not printing black ink and missing colours 
    Based on the comments, it looks like this will help 
    King_Zog wrote:
    I tried most of the suggestions in this thread, but stopped short of disassembling the print head. Nothing worked until I saw the video referenced in Sunshyn2005's message. That did work, but not on my first try. For the second attempt, I left the wet paper towels in place for a couple of hours to really soak the print heads. That did the trick.
    So, thank you Sunshyn2005, for pointing me to the solution.   - Source
    Although the printer might be out of warranty, if the issue persists, HP may be able to offer you something. Maybe they can offer you a discount on an alternate model. If you are in Canada or US call 800 474 6836, or you can Contact HP Worldwide.
    If this resolves the issue, please let me know so we can help others who may be experiencing the same issue.
    Please click the Thumbs up icon below to thank me for responding.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Sunshyn2005 - I work on behalf of HP

  • The report engine add a blank page at the end of report

    I have configured a group with the option "New page after" checked. The problem of that seems the engine add a new blank page at final of report. Exists some way for avoid that? Perhaps is possible add a formula for don´t allow that when is in the last page?
    Regards and many thanks for the help.

    Many thanks. That works

  • How can I disable the 'First Run' and 'Whats New' pages from showing after updating Firefox for all users that log onto a system.

    I am a system administrator and need a way to set a global preference to not open the Whats New and first run pages. I found the browser.startup.homepage_override.mstone preference in the user profile but want to be able to set this globally.

    Use a mozilla.cfg file in the Firefox program folder to lock prefs or specify default values.
    Place a file local-settings.js in the defaults\pref folder where you also find the file channel-prefs.js to specify using mozilla.cfg.
    pref("general.config.filename", "mozilla.cfg");
    pref("general.config.obscure_value", 0); // use this to disable the byte-shift
    See:
    * http://kb.mozillazine.org/Locking_preferences
    You can use these functions in mozilla.cfg:
    defaultPref(); // set new default value
    pref(); // set pref, but allow changes in current session
    lockPref(); // lock pref, disallow changes
    *http://kb.mozillazine.org/browser.startup.homepage_override.mstone

  • When using an external (ergonomic mouse) is there any way to get the wheel to scroll one full page at a time?

    When using an external (ergonomic mouse) is there any way to get the wheel to scroll one full page at a time? Much appreciated.

    I can't use the keyboard to scroll. I need to keep my hand on the mouse, otherwise I'd never get anything done. Since I have no problem getting Firefox to scroll one page at a time, and I'm constantly jumping between 3 browsers, it would be nice to be able to scroll a full page at a time in Safari, just like I can in Firefox. Thanks.

  • What are the options for integrating the event catalog and event landing pages in our website?

    We'd like to integrate the event catalog and event landing pages into our website but would prefer not to use the standard iframe embed code. Are there other solutions available, like an API or something else?
    Reason for this is that when we tried it with the iframe embed code the event catalog seems to load quite slow in a webpage on our website. Plus it seems we can't change the width and height of the event catalog with the CQ5 editor, or have the event catalog embed dynamically change in size depending on the amount of events in the catalog.

    Keeping everything in one scene is the better way to go.  Scenes are useful for animators who do not use navigation, they just make movies that play frame after frame without stopping.  But for anything that involves navigating the timeline you will have less headaches if you just avoid them and keep everything in the one main timeline.
    There are primarily two approaches to implementing pages in a timeline.  Either spread them out along the timeline and navigate from frame to frame to access them, or create them as movieclips (all in the same frame) and manage their visibility.  The latter approach makes it easier to maintain the status of a one page if navigating to another is necessary.  And you might find it useful to mix these two approaches at times.
    When you have everything on one timeline, you can have a layer dedicated to actionscript that you extend the full length of the timeline, which makes shareable code, such as variables and functions, available to anything along the timeline.  This avoids any need to have duplicate function definitions since you can have the same single function available to multiple pages in the site.  I usually use two actions layers... one for the shared stuff which has all code in frame 1 only, and another for frame specific code such as timeline commands and other action coding that needs to happen at particular frames.

  • My ipods frozen on the white apple and black background page. I've tried resetting with the hold button, but nothing's changed. How can I fix this!?

    My ipods frozen on the white apple and black background page. I've tried resetting with the hold button, but nothing's changed. How can I fix this!?

    Try this...
    Restarting your device
    1)   Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider.
    2)   Press and hold the Sleep/Wake button until the Apple logo appears.
    Follow these steps to reset your device
    Note: Reset your device only if it is no longer responding and the steps above do not work.
      Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears.
    Restart / Reset
    http://support.apple.com/kb/ht1430

  • Let's say I have a document that is 5 pages long. Now I want to insert the page numbers, starting on page 3 with the number "3" and leaving out pages 1 and 2. How do I do that?

    Let's say I have a document that is 5 pages long. Now I want to insert the page numbers, starting on page 3 with the number "3" and leaving out pages 1 and 2. How do I do that?

    I just found the answer myself. I don't know how to delete my question, so I'll just write the reply to the answer - just in case somebody needs to know: Insert a section brake after the second page and then choose "Start on 3".

  • I tried to publish my project of 2 html pages, 3 photo pages and one widget page (map) to ipage hosting site. the two html pages published and that's all. Help.

    I tried to publish my project of 2 html pages, 3 photo pages and one widget page (map) to ipage hosting site. the two html pages published and that's all. Help.

    What's the URL of your site so we can examine it first hand?   Also try publishing the site to a folder on your hard drive and use the free FTP client  Cyberduck to upload your site.  It's been known to work when iWeb's ftp client has failed.
    OT

  • Problem for getting the real path using one servlet and one jsp page

    I have one tomcat machine and several virtual domains. Eahc virtual domain has one realpath in the disc.
    I am using one servlet and one jsp page for using this servlet.
    my purpose is to load, using the servlet , the real path for the domains (eahc domain has its path).
    for this i make this:
    the servlet code is this:
    package utils.ticker;
    import java.io.*;
    import java.io.File;
    import java.io.IOException;
    import java.net.*;
    import java.util.*;
    import java.text.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    public class Edicion extends HttpServlet{
    public Edicion() {
    public String cc(){
    ServletContext myContext= getServletContext();
    String abspath = myContext.getRealPath("/");
    //here i want to return the real path
    return abspath;
    public static void main(String args[]){
    and the jsp page is:
    <%@ page import="utils.ticker.*" %>
    <jsp:useBean id="tick" class="utils.ticker.Edicion" scope="session"/>
    <html><head><body>
    <%
    tick.cc();
    %>
    </body></head></html>
    But this produces one error, NullPointerException and dont shows me the real path.
    Can anyone help me?
    thanks

    i have put this into one sevlet:
    package utils.ticker;
    import javax.servlet.ServletContext;
    public class Edicion{
    private ServletContext myContext;
    public Edicion(ServletContext myContext) {
    this.myContext = myContext;
    public String getCC(){
    return myContext.getRealPath("/");
    and in the jsp page this:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*"%>
    <%@ page import="utils.ticker.*" %>
    <jsp:useBean id="tick" class="utils.ticker.Edicion" scope="session"/>
    <html><head><body>
    <%=tick.getCC()%>
    </body></head></html>
    but appear this error in the tomcat.
    Can you, please, help me. i am trying to solve this during one week and i am desesperate.
    Thanks.
    ERROR:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: class utils.ticker.Edicion : java.lang.InstantiationException: utils.ticker.Edicion
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    javax.servlet.ServletException: class utils.ticker.Edicion : java.lang.InstantiationException: utils.ticker.Edicion
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
         at org.apache.jsp.pruebas_jsp._jspService(pruebas_jsp.java:72)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
         at java.lang.Thread.run(Thread.java:536)
    Apache Tomcat/4.1.18

  • When I try to download an app from the Creative Cloud dowload page, all I get is a blank page.

    When I try to download an app from the Creative Cloud dowload page, all I get is a blank page.I have just joined - am I doing something wrong?

    Hi Epoptops,
    Please try downloading from a different browser and check.

  • HT1595 My AppleTV seems to be stuck on the "Setting Date and Time" load page

    I just moved from a house to an apartment and when I hooked up my appleTV it said "Setting date and time" with a spinning load wheel and it's been doing this for a long time now. I hit MENU on the remote and tried going to Settings> General> Network like it said at the bottom of the screen, but nothing happened. It's connected to the right WiFi network, but the only icons it shows on the home screen are the 'Computers' icon (for Home Sharing) and the 'Settings' icon. My movies, music, tv shows, netflix etc. icons aren't showing up. I restarted it and got as far as the "Setting date and time" load page again, where it just sits and loads.

    Welcome to the Apple Community.
    Assuming this is not the first time you have used your Apple TV
        1.    You might try restarting the Apple TV by removing ALL the cables for 30 seconds.
        2.    Also try restarting the router.
        3.    If the problem persists, try a restore, you may want to try the previous procedures several times before doing this.
    If this is a new Apple TV, it may also be that your network router is not allowing access to the timeserver, check that your router allows access over port 123.

  • RoboHelp for Word: The Help file opens a blank page

    Hello,
    The Help files were working fine all these days. Today when i
    click on the help on the webpage, it shows a blank page. I am using
    RoboHelp for Word X5. I do not get any error message on the screen.
    I can just see the progress bar just blinking and also our website
    link which says transferring. None of my help files on the live
    applications are working
    Please help.
    Regards
    Chandrika

    That link works for me in IE and FF so I think we can rule
    out your output.
    If the problem is the call, anyone who accesses it via the
    link you gave me should be OK and only see the problem when the
    help is called via the application.
    If the problem is the help, anyone will see it, no matter how
    they access the help.
    I think both can be ruled out as they do not fit what you
    describe. I would therefore be inclined to forget the RH8 idea.
    You said
    "The clients are having the same problem again. It seems that
    the help page keeps refreshing again and again in their systems.
    When i checked it at office network, the systems that are connected
    through proxy are giving the problem. The other systems which are
    not connected through proxy are working fine."
    This is consistent but it is something IT will have to
    resolve.

  • HT5569 I am having trouble connecting to my wifi.  I put in the password (the correct password) and it tells me that it is the wrong password.  I just purchased this iPad and cannot seem to get connected.  My laptop connects with a pin not a password.

    I just bought a iPad and am trying to set it up.  I have WiFi at my home but cannot get on with my iPad.  My laptop asks for a pin number to join and the iPad asks for a password.  I enter the correct password and it tells me that it is incorrect.  I have talked to my WiFi carrier and they tell me that they do not know what it could be.  Can someone please help me figure this out.

    connectng with a pin # will not work with the ipad. you need to find out exactly what the actual wifi password is.
    pin and push buttons are used by wifi protected setup. which is an optional feture of WPA
    here are some ideas
    go to the routers home page (typically 192.168.1.1 or 192.168.1.254) and see if you can click on "show password"
    get the manual out, it should have the default user name and password you may need to access the routers page
    if your windows computer connects, then you should be able to right click the wifi connection and click on show password as well. this is somewhere in the properties page of the wifi connection
    also with windows its a good idea to click on "save wifi connection to usb drive" this can be used to connect other windows computers and xbox game consoles as well
    if your laptop computer is a mac book you can go to the keychain or icloud keycahin and reveal the actual passowrd as well.
    look at the actual router it might have directions on a sticker on how to access the routers configuration pages
    if you enter the wrong password on the ipad you need to forget the network and try again

Maybe you are looking for

  • Gallery in iWeb

    Ok I'm going to try to explain what I'm trying to do the best way I know how. What I'm want to know if this is possible to do in iWeb and iPhoto. First I have created a web site with 1 album. Everything seem to work ok. But what I want to add is a we

  • Random screen saver and iPhoto

    I use the random screen saver function but would really prefer that it not use images from iPhoto. I have hunted through the screen saver panel and through iPhoto prefs looking for a way to stop the screen saver function from using iPhoto data, but c

  • Join running JVM

    My program is win32 EXE written in C++. It calls java method through JNI. Now I must create and start new JVM each time the exe is started. Is it possible to find and join JVM that is already running?

  • Integral function-why it can not run

    Hi all, I am trying to write a code to draw a graph and calculate an area under the graph of sin function. When I run the code, it is working, but when I try to displace the GUI, there are two errors. - the graph did not appear in the GUI. It should

  • Wireless nearly working, but can't ping

    I've been trying to get wireless to work on my laptop using wpa_supplicant. I seem I be connected to the network, but I'm unable to ping google. Here's some info: bash-3.2# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf Trying to associate