Print dynamic content with printJob

Recently, I developed an application to help who built the interface and support all the hand and under navigation elements, content pages and dynamically associated resources. It was to make it easy to provide research and printing features, as well as an interface scalability. So my impression feature creates a MovieClip print layout (well to margins of 8.5 x 11 and printer) and load the appropriate text content, associated with the page visible on the screen when you press the "print" key.

I thought that the impression was ready to go, but what I've discovered, is that, once you print a page of the request for resources to help this page prints instead of any other page that you print from there on out.

My "print" key calls a function that pulls all the appropriate dynamic data (page title, content of the page, the names of the resources, etc.) and formats it as HTML and adds it to my MovieClips print text field layout (docPrint._txt).

That function then calls my function printJob which creates an empty sprite, adds my movieclip print layout of this sprite, resizes the text field of the MovieClip print layout to properly fit in the margins of the printer, and print the file.

Anyone have any ideas why my dynamic content print as the same page every time? Note that if I trace my text field content to my MovieClip content change print layout each time, but the impression remains the same.

Sorry for the long post and a huge thank you to all those who may have an answer.

Have a great day!

I am answering my own post I found a solution, although I'm now on bald of pulling all my hair. Hope this helps even a soul randomly in the future as the printJob class seems to be one of the most difficult to get help with or find the information concerning online.

My code dynamically creates the contents of the print page based on the content of the screen on which the user currently displays in my application. My print functions were always print the first page that was printed to any page in the application, the user was viewing.

As I learned to do, I was declaring the variables for my items printed in the root of my actionScript (outside of all functions so they can be accessed in all of functions).

I had two variables:
var docPrint:document = new document(); A layout of MovieClip for my printing page located in the my library
var printPage:Sprite = new Sprite(); The Sprite to keep my fine MovieClip to feel like a sprite is required

I also had two functions:
docContentsLoad(); Responsible for content in docPrint Movieclip and formatted
printJob(); Print job created adjusted for settings of the printer docPrint and sent print

It turns out the solution the simplest was combine my two functions in one printJob function and place my two variables (docPrint & printPage) at the beginning of the function. Printing now works fine everytime. Repeat over and over the pages.

My assumption is that the only way to truly deliver the print document should delcare the variables in the called function to print the document so that they are redeclares every time.

Tags: Adobe Animate

Similar Questions

  • Any success with the creation of dynamic content with the api?

    My company is looking to build a dynamic newsletter and we usually have a lot of articles, but we want to connect with elequa auto generate dynamic content. Then we can use this content to build the newsletter in a model. ? Someone at - it do something similar to this?

    This is an old issue, but for someone who comes here looking for answers:

    Your best bet in the future is to create a content Service AppCloud (develop a content AppCloud Service) under the new Framework Developer Eloqua AppCloud (Introducing Eloqua of AppCloud Developer Framework).  This will allow you to insert dynamically content in landing pages and emails.

  • Print the content of a dynamic text

    I can't print the content of a dynamic text

    The clip is: var dates: text_box = new boite_texte();

    Its content is generated by function:

    function onTxtComplete(e:Event):void {}

    .....

    dates.labelOut.text += (Heading1 + "\n\n" + day1 + "\n");

    }

    and appears regularly.

    Now I want to print the contents of dates.labelOut.text

    It works :

    function onPrint(e:MouseEvent):void {}
    var Note: String = "SOME DUMMY TEXT" + "\n\n\n";

    ...

    }

    But not with dates.labelOut.text :

    function onPrint(e:MouseEvent):void {}
    var Note: String = "SOME DUMMY TEXT", "\n\n\n" + dates.labelOut.text;

    ...

    }

    It is a problem of syntax?

    If the trace() works, then printing might work:

    var Note: String;
    button.addEventListener (MouseEvent.CLICK, onPrint);

    function onPrint(e:MouseEvent):void {}
    var today: Date = new Date();
    var Note: String = "EXPRESSION on a daily BASIS" + "" + date + "\n\n\n" + dates.labelOut.text;


    trace (score)

    var printNote:PrintJob = new PrintJob();

    If (printNote.start ()) {}
    try {}
    var pageSprite:Sprite = new Sprite;
               
    var noteText:TextField = new TextField();

    noteText.multiline = true;

    noteText.wordWrap = true;
    noteText.width = printNote.paperWidth;
    noteText.height = printNote.paperHeight;
    noteText.text = notes;
        
    pageSprite.addChild (noteText);
    printNote.addPage (pageSprite);
    } catch(e:Error) {}
    trace ("there was an error");
    }
    printNote.send ();

    pageSprite = null;

    }
       
    }

  • APEX 5 carousel with dynamic content

    Hi all

    is possibile creare a region carousel with only a subregion that render dynamic content?

    Sergio

    JoL says:

    is possibile creare a region carousel with only a subregion that render dynamic content?

    The carousel plugin can be reused for dynamic content refine the model of region of Carousel container and using a custom report template that renders each line in a report under a Pseudo-sous region, as in this demonstration.

    1. create a copy of the model region carousel called Carousel report containercontainer.

    2. change lines 14 to 18 of the model so that the #BODY# substitution string is contained in div.t-Region-carouselRegions :

    
    

    3 create a report of a named column model custom called Carousel Dynamic Content.

    4. define the structure required for each row in the dynamic content in model 1.

    • Lines 1 & 17 must reproduce the structure of the wrapper in the definition of the model in the model region of Carousel container subreqion definition. The source of report query must include a unique ID column for each row to be used in the SR_* value of the attribute ID.
    • 2 & 16 are based on the CSS source code classes and region of the subregions carousel on page 1200 of the universal theme Sample Application. The demo dm-ColorBlock class used in the sample is replaced by the custom carousel-content class that can be used to apply a custom style. The u-Color and h200 classes are defined in the theme and kernel of the APEX CSS and to control the color and height of Pseudo-sous-regions carousel respectively. (These classes are not documented you have to experiment to suit your needs.)
    • The code necessary to structure your content goes between these wrappers.

    5. create a region of classical report by using a SQL query that retrieves the dynamic content. This must include: a unique ID value for use in the ID of the elements attributes wrapper Pseudo-sous-region; the data values for the display; and all class information used to dynamically control the appearance of the Pseudo-sous regions.

    6 disable paging and partial-page refresh in the report attributes. and the number of lines and number of lines Maximum values that are appropriate for the data.

    7. some custom styles is likely to be required on the carousel-content element. I used the Inline CSS property page to apply padding to place content in the area of the carousel:

    .carousel-content {
      padding: 1em 3em;
    }
    
  • REST API: How to create e-mail/landing page with static/dynamic content?

    With the REST API, it seems that you can create/update the contents of an e-mail or a landing page by specifying html with the type "RawHtmlContent". How it works when this e-mail or a landing page includes a shared or dynamic content? What is the recommended method to create or update an e-mail/landing page and add a new shared or dynamic, content or update the "reference"?

    Unfortunately this is not currently supported by our API.  However, we are building a new point extension called content Cloud that can solve your use case.

  • Priority of the rules with dynamic content

    Does anyone know how the rules have priority in dynamic content?

    For example, I have three rules: content, content for designers and content developers default. If a person is designer and developer, I want to send them the content developer.

    Any ideas?

    -If anyone knows how to add names to the rules too, would be great. They are currently all record as "rule 1" "rule 2"... ".

    Thank you!

    The engine follows a short-circuit evaluation. It begins with rule 1, then goes to rule 2, etc.. The first rule is a football match is used. If no rule is met, then the default value is provided.

    I agree, it would be nice if the rules have been appointed. Please create it if it is not already there in the exchange of ideas!

    Aaron.

  • ScrollBar of a movieclip with dynamic content

    How to make the roll bar work for a movieclip with dynamic content.

    var senderLoad: LoadVars = new LoadVars();

    var receiveLoad: LoadVars = new LoadVars();

    senderLoad.sendAndLoad ("http://www.web.com/my_php.php", receiveLoad, "POST" ');

    receiveLoad.onData = {function (src)}

    var messageA:Array = src.split(",,,");

    messageA.pop ();

    var xPosition:Number = 0;

    var yPosition:Number = 0;

    for (var i: Number = 0; i < messageA.length; i ++) {}

    var msgA:Array is get [i].split(",,");.

    _root.patHolder.attachMovie ("garSpecBtn1", "btn" + i, _root.patHolder.getNextHighestDepth ());

    _root.patHolder ["btn" + i] ._x = which;

    _root.patHolder ["btn" + i] ._y = PositionY;

    PositionY = PositionY + 31.0;

    _root.patHolder ["btn" + i].textBlack.text = Msgto [0];

    _root.patHolder ["btn" + i] .number_lnk = "http://www.web.com/images/" + Msgto [0] + ".png"; ""

    _root.patHolder ["btn" + i] .txtN = "pattern" + Msgto [2];

    _root.patHolder ["btn" + (i)] .onRollOver = btnOverNumber;

    }

    }

    The scroll bar should work with patHolder.

    Add a scrollpane to your stage component and assign an instance name (for example, sp).  assign the symbol from the library of patHolder a login link (for example, patHolderID).  You can then use:

    sp.contentPath = "patHolderID";
    var _root.patHolder:MovieClip = sp.content;

    var senderLoad: LoadVars = new LoadVars();

    var receiveLoad: LoadVars = new LoadVars();

    senderLoad.sendAndLoad ("http://www.web.com/my_php.php", receiveLoad, "POST");

    receiveLoad.onData = {function (src)}

    var messageA:Array = src.split(",,,");

    messageA.pop ();

    var xPosition:Number = 0;

    var yPosition:Number = 0;

    for (var i: Number = 0; i

    var msgA:Array is get [i].split(",,");.

    _root.patHolder.attachMovie ("garSpecBtn1", "btn" + i, _root.patHolder.getN extHighestDepth());

    _root.patHolder ["BTN" + i] ._x = which;

    _root.patHolder ["BTN" + i] ._y = PositionY;

    PositionY = PositionY + 31.0;

    _root.patHolder ["BTN" + i].textBlack.Text = Msgto [0];

    _root.patHolder ["BTN" + i] .number_lnk = "http://www.web.com/images/" + Msgto [0] + ".png"; ""

    _root.patHolder ["BTN" + i] .txtN = "pattern" + Msgto [2];

    _root.patHolder ["BTN" + (i)] .onRollOver = btnOverNumber;

    }

    }

  • You want to print the contents of the textfield.

    I want to print the content of the text field with a button. I know how to print a clip. If I turn the text field in a clip, I can't type anything in it, and then I need to print an empty textfield... Help, tip? Thank you.

    There should be no problem converting your textfield to a movieclip and then by typing in it.  you do not really change it to a movieclip, you just add it to the timeline of the movieclip.

    but your textfield must already be in a displayobjectcontainer and so can be added to your printjob.  for example, if your textfield (for example, tf) is on the timeline in the scope, you can use:

    var pj:PrintJob = new PrintJob();

    b.addEventListener (MouseEvent.CLICK, f);

    function f(e:MouseEvent):void {}

    If (pj.start ()) {}

    try {}

    pj.addPage (this, Rectangle (tf.x tf.y tf.width, tf.height)) of new;

    } catch (error) {}

    handle the error

    }

    PJ. Send();

    }

    }

  • Can I REALLY print web pages with ePrint?

    I want to buy an ePrint printer. I know that I can print static web pages with my iPad via ePrint.
    But can also print dynamic web pages, or pages that I see after my login on my bank account?

    Example of dynamic web pages: http://drawisland.com/ or https://www.draw.io/
    Go to this page and draw something. You can print it via AirPrint?

    Thanks for any help or advice!

    Hello

    Did you ask an Airprint printer? For locations above, Yes. Any printer can print, but not all printers can use Airprint. One thing I want to mention here, printer will print the ENTIRE page. They allow you to save the drawings, you can save and print later.

    Kind regards.

  • print the contents of the web pages of android Tablet

    When I try to eprint from a web page, the web address line prints very well (with a bass line which reads: "sent from Samsung tablet"), but nothing about the content, even if print all preview shown on the page that I needed. Help, please!   The content of the web pages is an attachment and if so, how do I get an attachment to print?

    Hi TurboLady,

    Thank you for the update.  I appreciate it.  You read the document.

    The best way to print the content of the site is to print the web page using the browser in the HP ePrint app.  Please download and install the shop HP ePrint from the play of Google Mobile app . For reference, I have included the HP ePrint Mobile App FAQ document.

    Please let me know how it works for you.

  • My Hp photo smart 7960 printer does not always print the content of a page, it's just leaves the dashes and spaces.

    Original title: malfunction of the printer

    My Hp photo smart 7960 printer does not always print the content of a page, it's just leaves the dashes and spaces. Yet, some of it is printed. It always seems to be on the same site type. Other sites will still print ok... The uninstaller and reinstalling will correct or do I have to download updates?

    Hello

    What browser do you use?

    If this is the case with some specific websites then after return from the address of the site.

    I suggest you try the troubleshooting described in the article methods according if you use internet explore.
    I can't print or preview before printing a Web page in Internet Explorer
    http://support.Microsoft.com/kb/973479

  • Cannot print the content using Epson Stylus CX4700

    Can anyone tell how to get my printer Epson Stylus CX4700 to print?

    I can scan from the printer to the computer, but it will not print scanner or computer.

    Original title: Epson Stylus CX4700

    Hi Thomson,

    Welcome and thanks for posting in the Microsoft Community.

    From the description, I understand that you are unable to print the content using a printer.

    This issue would have occurred due to some hardware problems (printer).

    Please provide us with additional information to help you best:

    1. You did changes to the computer before the show?
    2. Have you received an error message / error code when you try to print the content?

    I suggest you to perform few of the steps mentioned in the article below and check out them if you are able to print the content in case of problems.

    Why can I not print?

    http://Windows.Microsoft.com/en-us/Windows/printer-problems-in-Windows-help#fix-printer-problems=Windows-7&V1H=win8tab3&V2H=win7tab1&V3H=winvistatab1&v4h=winxptab1

    Hope this information helps. For any other corresponding Windows help, do not hesitate to contact us and we will be happy to help you.

  • OKI Microline 184 Turbo printer works only with Windows 2008R2

    For Windows 2008R2, the test page is printed with the missing lines and introduces some corrupt characters.  Only 75% of content printed ok.  The printer works fine with other pilots and BONES.

    Hi mikechange,
    The question you posted corresponds to the Windows Server forums and would be better suited in the Technet forums. Please visit the link below to find a community that will provide the support you want.
    Hope this information helps.
  • Extensions of floating panels - adding dynamic content

    I work on the Dreamweaver extension and want to create a new floating panels. I am able to create...

    But, I have a (small) problem. Is it possible to add content dynamically?

    For example, let's say I have an HTML page containing a table with a variable number of columns. When the user select the node of the table, I want my extended floating panel automatically adds the column names (based on the thead element > tr > th data) as the new COLUMN NAME < p > < /p >.

    I have (yet) how to obtain the name of the columns... I just need to know if it is possible to add dynamic content in a floating panel and if it is possible, how?

    Thanks for your help!

    Just find the workaround... Instead of adding content, you can use object.innerHTML to set the html code. You can not add, but can completely rewrite the data in the DOM extension

    Thank you for all your help

  • Is it possible to view the code on dynamic content rules?

    We have problems with a bug that does not allow to fill us dynamic data content in a custom data object, and I wanted to try to play with the code. Is access to the code in the rules anyway? We can access the code of the content itself.

    Thank you!

    Hi Brittany,

    We have not documented these end points, but you can search and retrieve dynamic content sections using the following endpoint:

    • GET: / assets/dynamicContents? depth = {depth} & count = {number} & page = {page} & search = {search} & orderBy = {orderBy} & lastUpdatedAt = {lastUpdatedAt}

    The response to this appeal is as follows:

    {

    "items":]

    {

    'type': "DynamicContent"

    « id » : « 1 »,

    'converted': '1219180658 ',.

    "depth':"full. "

    "description": ","

    "folderId": "1418",.

    "name': 'sample product Promotions."

    "updatedAt": "1321729405",

    "updatedBy": "310"

    'defaultContentSection': {}

    "type': 'ContentSection."

    'id': '21 ',.

    'converted': '1289253558 ',.

    "createdBy": "12."

    "depth':"full. "

    "folderId": "320"

    "name': 'rule by default."

    "updatedAt": "1343658302",

    "updatedBy": "234"

    ""contentHtml":"

    example of content<\>«»

    "contentText": "our sample seminars cover all of the United States...". »,

    'forms': [],.

    "links":]

    {

    'type': 'hyperlink ',.

    « id » : « -1",

    "name': 'check now."

    'href': "" http:///\/ www.eloqua.com?elq=recipientid<\ pan="">& elqCampaignId =".

    }

    ],

    "images": [],.

    "scope": "local."

    'size': {}

    'type': 'Size',

    'width': '0',

    'height': '0 '.

    }

    },

    'rules':]

    {

    'type': 'DynamicContentRule ',.

    « id » : « 1 »,

    'contentSection': {}

    "type': 'ContentSection."

    « id » : « 8 »,

    'converted': '1287346933 ',.

    "createdBy": "9."

    "depth':"full. "

    "folderId": "320"

    "name': 'sample content."

    "updatedAt": "1323263825",

    "updatedBy": "51",.

    ""contentHtml":"

    example of content<\>«»

    "contentText": "example text."

    'forms': [],.

    "links":]

    {

    'type': 'hyperlink ',.

    « id » : « -1",

    "name':"survey. "

    'href': ' "http:///\/app.en25.com\/e\/er.aspx?s=1002&lid=704&elq=recipientid<\ pan="">".

    }

    ],

    "images": [],.

    "scope": "local."

    'size': {}

    'type': 'Size',

    'width': '0',

    'height': '0 '.

    }

    },

    'criteria':]

    {

    'type': 'ContactFieldCriterion ',.

    « id » : « 1 »,

    'condition': {}

    'type': 'TextValueCondition ',.

    "operator':"equal. "

    'value ':

    },

    "fieldId": "100047"

    }

    ],

    "depth':"full. "

    'Déclaration': '1 '.

    },

    ...

    ]

    }

    ],

    "page": 1.

    "pageSize": 1.

    'total': 100

    }

    Please note that this endpoint can change and we will seek to have a more complete documentation about this.

    Thank you

    Fred

Maybe you are looking for

  • Error number according to the sum

    $88.00 $0.00 $88.00 $0.00 $275.00 $275.00 $0.00 $0.00 $275.00 $275.00 $0.00 $0.00 $275.00 $275.00 $0.00 $0.00 $275.00 $275.00 $0.00 $0.00 $275.00 $275.00 $0.00 $0.00 $275.00 $275.00 $0.00 $0.00 $275.00 $275.00 $0.00 $0.00 $275.00 $275.00 $0.00 $0.00

  • Unable to stop

    original title: when I do a reboot or a judgment of my computer. He keeps Windows says that it disconnects and then it's there. I'm not computer. just a little. Same as above.

  • Error 0 X 00000116

    for months, I've been doing error screens and the computer sometimes just stops. The error message is Stop: 0 X 00000116(0XFFFFFA800BDA7010, 0XFFFFFA600112CFB8, 0X0000000000000000, 0X0000000000000002) atikmpag.sys - addressFFFFFA600112CFB8 base at FF

  • Rundll32.exe and CryptSvc constantly crashing on windows 7

    Hello guys, hope you can lend a hand with this. I have a desktop with Windows 7 Home Premium 64-bit - quad processor. He installed the SP1. I recently updated several files of windows and now I'm getting a lot of appcrashes of the rundll32.exe. I not

  • BlackBerry Smartphones eception exception uuid must be 36 characters?

    When I restart, this message showing up... eception exception uuid must be 36 characters. What can I do?