Printing Varies?

Hi, Im new to the printing side of Java so if this is a simple mistake I do apologise...
I have created a class that prints information, logos, rotated text and so on based on calculated positions (specific offsets from each other) and of course I have set the Graphics2D instances to translate based on a imagableX & Y using the provided methods of PageFormat.
The problem I seem to be having is I get varied results on varied computers, for example:
- On my home desktop Windows PC using PDFCreator It prints everything fine and how I want it.
- On my Macbook using the inbuilt PDF feature the contents have a slightly larger margin and results in everything being moved away from the origin slightly.
- On my work Windows PC using CutePDF and an all in one printer (Both of which give the same incorrect result) have an even larger margin where everything is pushed over even more...
The home PC is using the latest version of NetBeans (and JDK), the Macbook is using the latest JRE (1.5?) and the work computer is using JRE 1.6.
Does anyone have any ideas?
Thanks,
Ken

Theres alot of code to my printing method so I dont want to post it all here but the whole thing is based on a similar idea.
For example: I have an int for linePosition and int for columnPosition, I add to them when I've completed a line which determines the new x and y for the next shape/text.
Im thinking the problem is something to do with the following line:
g2d.translate(pf.getImageableX(), pf.getImageableY());where pf is my PageFormat instance. Im going to check this but Im guessing Im geting a different result from these methods on different machines although if its always printed to an A4 sheet the margins should be similar and not add an inch or 2 to the left and top edges....
Has anyone had problems like this and if so how did you overcome them?
All I want is to print some information onto an A4 sheet without the worry that its not speced correctly or clashing.
PS.
If anyone has a clever system/template of creating formal looking output reports please do share!
Regards,
Ken
EDIT: I may have found my problem but I need someone to confirm it.
In the tutorials I have followed they have used the setTransform() method of Graphics2D to switch to a new AffineTransform that they have created for a purpose and then used it again to switch back to the original but yet in the Sun java printing FAQ it says
Q: Why do I get unexpected results when I use the setTransform method of Graphics2D to perform transformations?+
A: Because the setTransform method is not intended for adding new coordinate transformations onto an existing transform. In fact, when you use setTransform, you are overwriting the Graphics2D object's current transform, which might be needed for other purposes, such as applying a scaling transformation to adjust for printer resolution. The setTransform method should ONLY be used to restore the Graphics2D transform to an earlier saved state after performing some temporarily transformed rendering.
Does that mean I cant apply new AffineTransforms (even if its a copy with more aditions) to Graphics2D and instead apply changes directly to the Graphics2D?
Edited by: MarksmanKen on 29-Mar-2010 14:39

Similar Messages

  • How do I add/remove print apps on my printer?

    The way you add apps to your printer varies depending on the model. 
    I. On the following printers, use the "Get More" icon on the device to add additional print apps directly on the device:  When you select the "Get More" icon on your printer front panel display, you will see a list of available apps for your pinter, and you can select and add apps to your printer from there:  
    HP Photosmart c309n-s
    HP Photosmart Premium C310 series
    HP Photosmart eAll-in-One Printer D410 series 
    To remove apps on these printers, select the "Get More" icon, and then select the "Manage Apps" button (at the top-left of the Touchsmart Web Apps" screen that appears).  That will open the "Manage My Favorites" screen where you can remove apps by selecting the "X" on the app icons.  
    Any configuration required for print apps (e.g., entering Zip Code) on these devices will be prompted for when you run the print app. 
    II. On the HP eStation (with the removable tablet display).  
    Add apps: Select the tab (with the upwards arrow on it) at the bottom of the screen to open the app drawer.  Then select the Add Apps option at the bottom of the screen to view available print apps.  
    Delete apps: Select the tab (with the upwards arrow on it) at the bottom of the screen to open the app drawer.  Scroll down to display the Print Apps section.  Select the Delete option and then select the app you wish to delete.   
    III. On other web-connected printers, if you select the "Get More" icon it will provide you the web site address for HP ePrintCenter - www.hpeprintcenter.com.  You go there to add new apps, view apps on your printer, and setup/remove apps from your printer.  
    For those devices, to add more print apps: 
    Go to www.hpeprintcenter.com and log into your account.  If you don't have an account yet, create an account and add your printer.  Information on doing that can be found here:  http://h30434.www3.hp.com/t5/ePrint-Print-Apps-Mobile/Add-your-printer-to-your-HP-ePrintCenter-accou...
    Select the "Get More Print Apps" link in the Print Apps section (below the ePrint section).
    Select the icon of the print app you want to install, and then on the print app detail page select the "Add to Printer" button.  If the print app requires setup, after adding it you will see a "Setup" button which you should select to configure the print app so it is ready to use.  
    To remove apps on these printers, select the "My Apps" link to display the apps installed on your device.  Hold your mouse over the print app you would like to remove and a red X will appear, select the red X to remove the app.  
    As soon as you add or remove the print app from the HP ePrintCenter it will be removed/added on your printer...select the "Apps" icon to see all currently installed apps on your printer.  
    Note:  Not all print apps are supported on all printers, and apps may be limited to cetain countries or languages.  If you don't see a print app you are looking for when you access the "Get More Print Apps" link, that app is not currently available for your printer.  We are regularly working on creating new apps and extend the printers on which existing apps are available, and you will see a star notification icons on the Get More icon on your printer when new apps are available.  
    I am an HP employee.

    Help!  DAILY READ has become a daily beast.  How do I delete it????
    [email protected]

  • Printing an iframe with pdf using javascript is not working in IE8 and above

    I have a problem with printing and Iframe with PDF in IE 8 and above
    Following is my javascript:
    var urlValue="";//Path of the file to be printed
    var div = document.getElementById("printerDiv");
    div.innerHTML = '<iframe src="' + urlValue + '" id="frame" name="frame" style="width:100%;height:100%;"></iframe>';
    frame.focus();
    frame.print();
    This same thing is working fine in other browser but for IE is just not invoking the print dialog.
    Also I tried to get the frame.print(); on load of the frame but even that is not working exactly as that way it print the parent window in output.
    Few things I tried like:
    1) div.innerHTML = '<iframe src="' + urlValue + '"
    onload="this.contentWindow.print();"></iframe>';
    2) frame.contentWindow.focus();
    frame.contentWindow.print();
    3) window.document.getElementsByTagName('iframe')['frame'].onload = (function () {
    frame.focus();
    frame.print();
    I need to get the print of only the content which is in Iframe which I am binding in "printerDiv" by javascript.
    Any perfect/different solution from which I have tried then please post here?
    Thanks.

    PDF documents are hosted in an ActiveX or netscape plugin control which have their own printing functions.
    Start>Adobe Reader>Edit>Preferences - to adjust what functionality the PDF document viewer addon displays (menus etc).
    Tools>Manage Addons>Show all addons
    make sure you have both the x86 and x64 versions of your PDF reader Active X control installed and enabled. I would recommend also that you update to the latest version of the vendors' (Adobe?) plugin.
    Possibly you have disabled scripting of ActiveX controls in the IE security zone that your parent page maps to. Also there is an IE security zone feature that prevents navigation to a domain in a zone of lower integrity.
    Tools>Internet Options>Security tab, click "Reset all zones to default".
    when asking developer related questions it is helpful if you can include a link to your website.
    Rob^_^

  • Load a PDF and Print it Without User Seeing the PDF

    I have a client who has a need to allow users via a web browser to print PDFs wihtout gaining direct access to them.  Ignoring all the flaws in this logic , I am new to Flex and am having difficulty determining if this is possible.  So, here are the details:
    1) This is a web browser application.
    2) The files reside on a server.
    3) The user will view a list of available PDF files in their browser.
    4) There will be a print icon next to each one.
    5) When they click on the print icon we need to pull in the PDF from the server and initiate a print, all without the user seeing the PDF.  So once they click the print icon the next thing they see is thier browser's print dialog box.
    I have 1-4 done, I just need help with the most important one, #5.
    So, can Flex (without AIR) load a PDF in without displaying it and print it?
    I am using Flash Builder 4.6, if it matters.
    Thanks in advance for any input.

    Well, that's going to be difficult. Before everything else, a silent printing in general, is not what Browser is all about. A print dialog is thrown by the browser when a user selects a print option. Same thing if an application is trying to print using built into it conventional methods of printing - you get Print dialog. It gets even harder if you want to print PDF files silently. You will need to make sure that a file is available to print in case it's generated on the fly. The following code will print your PDF without dialogs to a selected (var printer) printer:
    var WshShell = new ActiveXObject("WScript.Shell");
    var fs = new ActiveXObject("Scripting.FileSystemObject");
    var fi = "AcroRd32.exe /N /T " + '"c:\\temp\\' + "filename" + '" ' + printer;
    WshShell.Run(fi, 0, false);
    As you notice, the file is on the local system. Or you can try printing over the network.
    This code will be a part of a JS function in your html wrapper. You will call this function from Flex using ExternalInterface.
    AcroRd32.exe is an Adobe free PDF reader.  I would suggest starting from the end - have a file on the local system and working on everything esle.
    HTH

  • Printing client side with Applet!!!

    Hi,
    Does anyone can help me with my applet. It must get the current page and print it in landscape out over at the user side (local printer).
    Here some sample of my source to help....
    // JavaScript part
    function print(){
    var myURL = document.location.href;
    alert(myURL);
    testApplet.print(myURL);
    // Applet part
    public class MyClass extends Applet implements Pageable, Printable {
    // .... some source ...
    public void print(String myURL) throws IOException, PrinterException {
    PrinterJob job = PrinterJob.getPrinterJob();
    PageFormat landscape = job.defaultPage();
    Paper sheet = new Paper();
    sheet.setImageableArea(0,0,landscape.getImageableWidth()+ (landscape.getImageableX()*2),landscape.getImageableHeight()+(landscape.getImageableY()*2));
    landscape.setPaper(sheet);
    landscape.setOrientation(PageFormat.LANDSCAPE);
    JTextPane txt = new JTextPane();
    txt.setPage(myURL);
    // this method initialise the parameters for the printing
    initialise(txt.getText(), landscape);
    job.setPageable(this);
    job.print(); ///// THE PROBLEM IS HERE
    java.awt.print.PrinterException: No print service found.
    at sun.print.RasterPrinterJob.print(Unknown Source)
    at sun.print.RasterPrinterJob.print(Unknown Source)
    at PageableText.test1(PageableText.java:151)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
    at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
    I have printers define and they worked well. Also, I have use the same code but without the Applet (calliing it from the main and with a static url) and it work perfectly. I'm pretty sure it's the Applet who's causing trouble.
    Anyone has any idea or sample to help me?
    Thanks

    It has to do with the JS call to the print method. I got around it by calling my printData() method in a separate thread...
    try something like this:
    ============================
    public void jsPrintData()
    if ( isPrinting )
    return;
    isPrinting = true;
    Thread runner = new Thread()
    public void run()
    printData();
    runner.start();

  • PrintParams "silent" ignores PDF Print Preset to Duplex

    Hello All,
    Here is my script to send a PDF to the default printer.
    var pp = this.getPrintParams(); 
    var fv = pp.constants.flagValues;
    pp.flags = (fv.setPageSize=false);//Sets the Auto-Rotate and Center Flag
    pp.interactive = 0;// 0=interactive, 1=auto, 2=silent
    pp.pageHandling = 3;//3=shrink to fit
    this.print(pp);
    the problem is that my PDF has my desired Document Properites Print Dialog Preset "DuplexMode" set to Duplex Flip Short Edge, and that property is ignored if the interactive is set to silent or automatic. It is honored if the print dialog is prompted and the user enters "OK".
    The  pp.flags = (fv.setPageSize=false); seems to be undocumented, but I stumbled upon it and it produces the desired result (sets Auto Rotate and Center). I hope it may be helpful to others.
    Any ideas why my preset is being ignored in silent mode, and any way to make it work?
    Thank you in advance and Happy Holidays,
    Message was edited by: kentgbaker
    Thom Parker was good enough to demonstrate the documented way to set auto-rotate and center.
    var pp = this.getPrintParams(); 
    pp.flags &= ~pp.constants.flagValues.suppressCenter
    pp.flags &= ~pp.constants.flagValues.suppressRotate
    pp.interactive = 0;// 0=interactive, 1=auto, 2=silent
    pp.pageHandling = 3;//3=shrink to fit
    this.print(pp);

    Hello All,
    Here is my script to send a PDF to the default printer.
    var pp = this.getPrintParams(); 
    var fv = pp.constants.flagValues;
    pp.flags = (fv.setPageSize=false);//Sets the Auto-Rotate and Center Flag
    pp.interactive = 0;// 0=interactive, 1=auto, 2=silent
    pp.pageHandling = 3;//3=shrink to fit
    this.print(pp);
    the problem is that my PDF has my desired Document Properites Print Dialog Preset "DuplexMode" set to Duplex Flip Short Edge, and that property is ignored if the interactive is set to silent or automatic. It is honored if the print dialog is prompted and the user enters "OK".
    The  pp.flags = (fv.setPageSize=false); seems to be undocumented, but I stumbled upon it and it produces the desired result (sets Auto Rotate and Center). I hope it may be helpful to others.
    Any ideas why my preset is being ignored in silent mode, and any way to make it work?
    Thank you in advance and Happy Holidays,
    Message was edited by: kentgbaker
    Thom Parker was good enough to demonstrate the documented way to set auto-rotate and center.
    var pp = this.getPrintParams(); 
    pp.flags &= ~pp.constants.flagValues.suppressCenter
    pp.flags &= ~pp.constants.flagValues.suppressRotate
    pp.interactive = 0;// 0=interactive, 1=auto, 2=silent
    pp.pageHandling = 3;//3=shrink to fit
    this.print(pp);

  • Windows 2008 R2 - Printer "Offline" SNMP issue.

    The issue:
    Not unique from what I have read in these forums and elsewhere around the globe.  But essentially, I have printers that go "offline" and only come back into life if I disable SNMP per printer port and therefore lose any "real" status messages.
    Some Environmental Information:
    - The printers and the print server are on the same logical subnet
    - There is no filtering/Firewall between the printers and the print server and not relevant given they are on the same logical subnet.
    - The firewall is disabled on the Print Server
    - The SNMP community string(s) configured on the printer matches that of the print server port
    - The manufacturing model of the printer varies.  Various print vendor makes and models, of the 5-6 affected devices, all of them are different.
    The following information relates to the newest printer a Ricoh Aficio MP C4501, manufactured and released in 2011 which is one of the models that has the issue
    - The Printer's NIC firmware is up to date (applied myself as I work for this particular print vendor) and is fully compliant with SNMP V1, V2 and V3 and supports all relevant MIBs
    - When the issue occurs, I can access the printer's web configuration page
    - When the issue occurs, I can ping the printer device showing "offline" on the print server
    - When the issue occurs, I can interrogate the printer device using an SNMP browser (many different types) on SNMP V1, V2 and V3 without issue
    - When the issue occurs, I can monitor the device and get detailed status updates using SNMP V1, V2 and V3 in the print vendors own device management application as well as Spiceworks without issue
    Note:
    I am quite confident that there is not a communication issue with SNMP to/from the device.
    I am quite confident that there is not an issue with the printers NIC in terms of firmware
    I can get around this by disabling SNMP per port, but this is _NOT_ a fix because "actual" status' other than "online" are never reported.
    Summary:
    I'm going out on a limb here and suspecting that the root cause is not the device, firmware or print driver, but in fact something within Windows Server Print Subsystem.  To that end and given there has been a huge amount of discussion on this issue,
    is there any progress or even acknowledgement that this _MIGHT_ be a problem that Microsoft need to address?
    --------------------------- ASE, CNE, CCNP, CLP, MCSE --------------------------

    Hi Alan,
    Lately I experienced this "printer-offline-problem" on my
    Windows Server 2008 R2 Standard, Service Pack 1 . I found this thread on the internet and probably tried out everthing mentioned here. But nothing helped in my case. When I deleted and recreated this printer, it was in status Ready and was working as
    long there was no restart of the print spooler service. Then it switched to offline and stopped working.
    So I did open a support case at Microsoft as recommended by you.
    It didn't help to install the latest hot fixes or to delete third party language monitors from the registry. What did help, I found out two weeks ago and I want to share it here for other people having the same problem.
    1. Delete the "Offline"-printer and its port.
    2. Search the Registry for the printer name. You might find these keys:
    [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Hardware Profiles\0001\System\CurrentControlSet\Control\Print\Printers\***problemprinter***]
    "PrinterOnLine"=dword:00000000
    [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Hardware Profiles\Current\System\CurrentControlSet\Control\Print\Printers\***problemprinter***]"PrinterOnLine"=dword:00000000
    3. Recreate this printer - done!
    4. Test it by restarting the print spooler service - if you like.
    If you cannot delete the printer, because you don't want to lose the print jobs in the queue, try to find the above mentioned registry keys and delete them. Then restart the print spooler service. The printer will
    switch to Ready and start printing.
    Microsoft then confirmed they have comparable cases like this in their database, but no information why there are these registry keys and why they arouse this problem.

  • Acrobat reader print with javascript script

    Hello,
    I read the documentation for printing silently using javascript, but it does not work as not all COM objects are installed.
    A code example:
    <body>
    <object id="examplePDF" data="DFWCRT133735.PDF" type="application/pdf" title="SamplePdf" width="100%" height="100%">
       Your browser does not support PDF, Please install Adobe Acrobat.
    </object>
    <div id="pdfprop">
    </div>
    <script type="text/javascript">
        var pdf = document.getElementById("examplePDF");
        var divProps = document.getElementById("pdfprop");
        if (pdf) {
    // Attempt 1: Works, but shown printing dialig which I do not want
    //        pdf.print();
    // Attempt 2: Does not work. Shows an exception about parameters when printing
            //var printParms = { bUI: false, bSilent: true, bShrinkToFit: true };
            //pdf.print(printParms);
    // Attempt 3: Does not work as can't instatiate unexistent progid, class AcroExch.PDDoc. COM object is not registered
            var srcDoc = new ActiveXObject("AcroExch.PDDoc");
            var jsObj = srcDoc.GetJSObject();
            var pp = jsObj.getPrintParams();
            pp.interactive = pp.constants.interactionLevel.automatic;
            pdf.print(pp);
    </script>
    </body>
    I read in google something about the Acrobat Pro version will have the missing COM object, but I can't force all my clients to buy that product. Is it possible with the reader version.
    I'll appreciate any help.

    I am trying with Reader 9.
    I am not trying to print from the server. The printing will happen on the client computers that is why I am trying to print using javascript from an html page. My clients do have different versions of Reader from 6 to latest
    Is there any way to achieve it with out installing anything else on the computers?
    Thanks,

  • Print specific webpart of a page in SharePoint.

    I create a page that conatins two webparts side by side. One is an Anvanced Search Box and the other a DWP that shows the data from a Custom SharePoint List. I'm tryin to create a Print button to print only one of the webparts, as you can imagine, I'm interested
    in printing the Search Box. I have tried several methods and so far no luck.
    Method 1. Both webpart print
    <input onclick="window.print();return false;" type="button" value=" Print this page "/>
    Method 2. The same both WP print. I'm inserting the right ID
    var WebPartElementID = "XXXXXX-XXXXX";
    //Function to print Web Part
    function PrintWebPart()
    var bolWebPartFound = false;
    if (document.getElementById != null)
    //Create html to print in new window
    var PrintingHTML = '<HTML>\n<HEAD>
    <meta name="WebPartPageExpansion" content="full" />\n';
    //Take data from Head Tag
    if (document.getElementsByTagName != null)
    var HeadData= document.getElementsByTagName("HEAD");
    if (HeadData.length > 0)
    PrintingHTML += HeadData[0].innerHTML;
    PrintingHTML += '\n</HEAD>\n<BODY>\n';
    var WebPartData = document.getElementById(WebPartElementID);
    if (WebPartData != null)
    PrintingHTML += WebPartData.innerHTML;
    bolWebPartFound = true;
    else
    bolWebPartFound = false;
    alert ('Cannot Find Web Part');
    PrintingHTML += '\n</BODY>\n</HTML>';
    //Open new window to print
    if (bolWebPartFound)
    var PrintingWindow = window.open("","PrintWebPart", "toolbar,width=800,height=600,scrollbars,resizable,menubar");
    PrintingWindow.document.open();
    PrintingWindow.document.write(PrintingHTML);
    // Open Print Window
    PrintingWindow.print();
    Method 3. I found this proposed solution in this forum (Here). This method doesn't work for me at all.
    function PrintPreview(){
    var sURL=document.location.href;
    if (sURL.indexOf('?') >0) { sURL=document.location+"&PrintPreview";}
    else { sURL=document.location+"?PrintPreview";} window.open(sURL); }
    // If we are in Print Preview Mode then Hide a bunch of styles.
    if (document.location.href.indexOf('PrintPreview') >0) { document.write('<style>');
    document.write('.pa-printicon, .jm-toolbar, .ms-navframe,.ms-bannerframe,.ms-sbtable,.ms-searchform,.ms-sbtopcorner,.ms-sblbcornerumb,.ms-globalbreadcrumb,.ms-pagetitleareaframe table { display: none; } ');
    document.write('div.ms-titleareaframe { border-top: 0px white solid; } ');
    document.write('</style>'); print(); }
    EM

    Hi emfuentes27,
    Insert a Content Editor Web Part and edit the source code. Add the following to it:
    <input type="button" OnClick="javascript:void(PrintWebPart())" value="Print Web Part">
    <script language="JavaScript">
    //Controls which Web Part or zone to print
    var WebPartElementID = "<WebPartElementID>";
    //Function to print Web Part
    function PrintWebPart()
    var bolWebPartFound = false;
    if (document.getElementById != null)
    //Create html to print in new window
    var PrintingHTML = '<HTML>\n<HEAD>\n';
    //Take data from Head Tag
    if (document.getElementsByTagName != null)
    var HeadData= document.getElementsByTagName("HEAD");
    if (HeadData.length > 0)
    PrintingHTML += HeadData[0].innerHTML;
    PrintingHTML += '\n</HEAD>\n<BODY>\n';
    var WebPartData = document.getElementById(WebPartElementID);
    if (WebPartData != null)
    PrintingHTML += WebPartData.innerHTML;
    bolWebPartFound = true;
    else
    bolWebPartFound = false;
    alert ('Cannot Find Web Part');
    PrintingHTML += '\n</BODY>\n</HTML>';
    //Open new window to print
    if (bolWebPartFound)
    var PrintingWindow = window.open("","PrintWebPart", "toolbar,width=800,height=600,scrollbars,resizable,menubar");
    PrintingWindow.document.open();
    PrintingWindow.document.write(PrintingHTML);
    // Open Print Window
    PrintingWindow.print();
    < /script>
    Once you have done the above, you need to find the web part id of the web part you want to print when this button is clicked.
    To do that, you view the source of the page and look for the web part title corresponding to the web part. It looks something like this:
    <div WebPartID="0e77b913-99e6-402c-8558-cdd5a2100eb2" HasPers="false" id="WebPartctl00_m_g_0e77b913_99e6_402c_8558_cdd5a2100eb2" width="100%"
    allowDelete="false" >
    The id that you're interested in to replace <WebPartElementID> in the javascript above is highlighted.
    Once it's all there, click on the button and a window will pop open that contains only the contents of the web part. Feel free to print
    Thanks,
    Jack
    Jack Gao
    TechNet Community Support

  • What is the difference between System.out.println() and System.out.print()?

    Hi everyone,
    I am only a new comer and know very little about Java. I will appreciate a lot if anyone teaches me what the difference between two method println and print is? Thank you so much.

    The PrintStream class defines a number of print() methods that ... print
    things. System.out is a commonly used PrintStream.
    The difference between the print(...) and println(...) methods is that the
    second one prints a new line at the end. What it actually prints varies
    from system to system: sometimes it will output a '\n' sometimes not.
    There is a system property called line.separator that determines
    how a new line is output.

  • Printing of movieclip without stage color

    Greetings all,
    I have a flash stage which is in grey color. I have a blank movieclip which is in light pink in bgcolor. Can anyone tell me why when I tried to print the movieclip, my paper background will be printed grey? Is it because of my flash stage color? How do I fix this? (my original paper is white in color)
    Thanks for your time,
    -Zainuu

    Hi kglad, I will be putting a datagrid inside the printClip movieclip
    printClip.addChild(dg);
    and I will need to print out all the data inside the datagrid, so I need those values to ensure that all data will be printed (if datagrid verticial scroll policy is TRUE)
    is there other ways? Resizing of the rectangle properly or set to print no background color?
    whole script:
    for (var i = 0; i < 30; i ++)
        dp.addItem({no:i+1, Winner_Name:"Name_Name_Name_Name_Name_Name_"+(i+1), Prize_Title:"Title_Title_Title_Title_Title_Title_Title_"+(i+1),      Prize_Name:"PrizeName_PrizeName_PrizeName_PrizeName_PrizeName_"+(i+1)});
                SampleData.push(dp);
    myDataGrid.columns= ["no","Winner_Name","Prize_Title","Prize_Name"];
    myDataGrid.getColumnAt(0).width = 50;
    myDataGrid.getColumnAt(1).width = 160;
    myDataGrid.getColumnAt(2).width = 170;
    myDataGrid.getColumnAt(3).width = 170;
    myDataGrid.dataProvider = dp;
    myDataGrid.setSize(463, 178);
    myDataGrid.horizontalScrollPolicy = ScrollPolicy.ON;
    clickme.addEventListener(MouseEvent.CLICK, clickmeFn)
    var printClip:MovieClip = new MovieClip();
    clickme2.visible = false;
    clickme2.enabled = false;
    function clickmeFn(e:MouseEvent){
              //creates a moveclip and a datagrid to print
              var dg:DataGrid;
              printClip.graphics.beginFill(0xFFFF2FF);
              printClip.graphics.drawRect(0, 0, 100, 100);
              printClip.graphics.endFill();
              printClip.x = 0;
              printClip.y = 0;
              addChild(printClip);
              this.setChildIndex ( printClip , this.numChildren - 1 );
              printClip.visible = true;
              dg = new DataGrid();
              dg.move(0, 0);
              dg.setSize(570, 178);
              dg.rowHeight = 40
              dg.rowCount = myDataGrid.length ;
              dg.columns = ["no","Winner_Name","Prize_Title","Prize_Name"];
              dg.getColumnAt(0).width = 50;
              dg.getColumnAt(1).width = 160;
              dg.getColumnAt(2).width = 170;
              dg.horizontalScrollPolicy = ScrollPolicy.OFF;
              dg.verticalScrollPolicy = ScrollPolicy.OFF;
              dg.dataProvider = dp;
              printClip.addChild(dg);
              // Assign cellRenderers.
              var col1:DataGridColumn = new DataGridColumn();
              col1 = dg.getColumnAt(1);
              col1.cellRenderer = MultiLineCell;
              // Assign cellRenderers.
              var col2:DataGridColumn = new DataGridColumn();
              col2 = dg.getColumnAt(2);
              col2.cellRenderer = MultiLineCell;
              // Assign cellRenderers.
              var col3:DataGridColumn = new DataGridColumn();
              col3 = dg.getColumnAt(3);
              col3.cellRenderer = MultiLineCell;
              //print button activated
              clickme2.visible = true;
              clickme2.enabled = true;
              this.setChildIndex ( clickme2 , this.numChildren - 1 );
              clickme2.addEventListener(MouseEvent.CLICK, clickmeFn2)
    function clickmeFn2(e:MouseEvent){
              printDG();
    function printDG(){
        var my_pj = new PrintJob();
        var myResult = my_pj.start();
        if (myResult) {
            var clipHeight = printClip.height;
            var _pageHeight = my_pj.pageHeight;
            var numPages = Math.ceil(clipHeight/_pageHeight);
                        var xMargin = -20;
            var _yMin = 0;
                        var _yMax = 0;
            for(var i:int=0;i<numPages ;i++){
               _yMax = _yMin + _pageHeight;
                           my_pj.addPage(printClip,new Rectangle(xMargin,_yMin, my_pj.pageWidth, _pageHeight));
                           _yMin = _yMax;
            my_pj.send();
            my_pj=null;
    The reason I got clickmeFn2 is because if I call printDG(); at the end of clickmeFn, it prints nothing. I have no idea why is that so...
    Thanks,
    -Zainuu

  • Load image using the loader class problem

    Hi, I'm trying to load an image in a movieclip using using the following:
    Load_image_btn.addEventListener(MouseEvent.CLICK,Load_image);
    function Load_image(event:MouseEvent):void
        var my_loader:Loader = new Loader();
        my_loader.load(new URLRequest("C:\Users\Amanda\Desktop\picture1"));
        addChild(my_loader);
    When I enter just "picture1" for the location it works, but like this it is giving me the following error: Error #2000: No active security context.  How can I go about this, as I want to have a picture which in a separate location from that of the flash file?
    I would also like to have the image located in a particular location (x,y) of the movieclip, is this possible? thanks in advance.

    I am using the following code:
    function AddViewDetails(event:ListEvent):void
    var mc:MovieClip=new Additional_Req_Info();  // where Additional_Req_Info is the class name
    addChild(mc);
    var clickedName:String = event.currentTarget.name;
    trace (clickedName);      /////prints Current_Req_List
    var instanceName:String = clickedName + (Current_Req_List.selectedIndex + 1);
    trace (instanceName);  /////prints Current_Req_List1,  Current_Req_List2, etc depending on list item selected
    if(!getChildByName(instanceName)){
    var classRef:Class=Class(getDefinitionByName(instanceName));
    trace (classRef);   ////not printed
    var mc:MovieClip=new classRef();
    mc.name=instanceName;
    trace (mc.name);   ////not printed
    And its giving me the following error:
    ReferenceError: Error #1065: Variable Current_Req_List1 is not defined.
    at global/flash.utils::getDefinitionByName()
    at Websiteversion4_Scene1_fla::MainTimeline/AddViewDetails()[Websiteversion4_Scene1_fla.Main Timeline::frame1:185]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at fl.controls::SelectableList/handleCellRendererDoubleClick()
    How can I define the list items if they are dynamically generated i.e. at runtime? thanks!!!

  • Execute procedure with out parameter in sql*plus

    HI All,
    I am executing an stored proc with OUT parameter from sql*plus.
    Getting this error message:
    SQL> execute sp1_cr_ln_num('01',0,3);
    BEGIN sp1_cr_ln_num('01',0,3); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to
    'sp1_cr_ln_num'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Whereas it works fine using Toad. 4th parameter is for output.
    Thanks.

    then you can see the value either using print :var or execute dbms_output.put_line(:var)

  • Installing Apache 2.4.3 on OSX 10.6.8

    Hi,
    I'm trying to install Apache web server on Mac OSX 10.6.8. On my first attempt with ./configure, I was informed that my apr version was too old. So I downloaded apr and apr-util, and as instructed by the Apache INSTALL doc, I upacked those files and moved their directories to httpd-2.4.3/srclib/apr and httpd-2.4.3/srclib/apr-util:
    ~/Downloads/httpd-2.4.3/srclib$ ls MakefileMakefile.in     apr          apr-util
    Then the Apache INSTALL doc said to run configure like this:
    ~/Downloads/httpd-2.4.3 $ ./configure --with-included-apr
    Then I got a new error:
    configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
    So I looked at the Apache installation docs here:
    http://httpd.apache.org/docs/current/install.html
    which say:
    REQUIREMENTS
    Perl-Compatible Regular Expressions Library (PCRE)
    This library is required but not longer bundled with httpd. Download the source code from http://www.pcre.org, or install a Port or Package. If your build system can't find the pcre-config script installed by the PCRE build, point to it using the --with-pcre parameter. On some platforms, you may have to install the corresponding -dev package to allow httpd to build against your installed copy of PCRE.
    So I downloaded pcre and installed pcre with ./configure, make, make install, which seemed to install pcre correctly. But when I tried to run ./configure for Apache, Apache still couldn't find pcre. So next I tried:
    ~/Downloads/httpd-2.4.3$ ./configure --with-included-apr --with-pcre=../pcre-8.32/pcre-config
    and this time ./configure seemed to end normally.
    On to make:
    ~/Downloads/httpd-2.4.3$  make
    But make ends with pcre errors:
    Downloads/httpd-2.4.3/modules/cache -I/Users/7stud/Downloads/httpd-2.4.3/modules/core -I/Users/7stud/Downloads/httpd-2.4.3/modules/database -I/Users/7stud/Downloads/httpd-2.4.3/modules/filters -I/Users/7stud/Downloads/httpd-2.4.3/modules/ldap -I/Users/7stud/Downloads/httpd-2.4.3/modules/loggers -I/Users/7stud/Downloads/httpd-2.4.3/modules/lua -I/Users/7stud/Downloads/httpd-2.4.3/modules/proxy -I/Users/7stud/Downloads/httpd-2.4.3/modules/session -I/Users/7stud/Downloads/httpd-2.4.3/modules/ssl -I/Users/7stud/Downloads/httpd-2.4.3/modules/test -I/Users/7stud/Downloads/httpd-2.4.3/server -I/Users/7stud/Downloads/httpd-2.4.3/modules/arch/unix -I/Users/7stud/Downloads/httpd-2.4.3/modules/dav/main -I/Users/7stud/Downloads/httpd-2.4.3/modules/generators -I/Users/7stud/Downloads/httpd-2.4.3/modules/mappers  -prefer-non-pic -static -c util_pcre.c && touch util_pcre.lo
    util_pcre.c:48:18: error: pcre.h: No such file or directory
    util_pcre.c: In function 'ap_regfree':
    util_pcre.c:103: error: 'pcre_free' undeclared (first use in this function)
    util_pcre.c:103: error: (Each undeclared identifier is reported only once
    util_pcre.c:103: error: for each function it appears in.)
    util_pcre.c: In function 'ap_regcomp':
    util_pcre.c:129: error: 'PCRE_CASELESS' undeclared (first use in this function)
    util_pcre.c:131: error: 'PCRE_MULTILINE' undeclared (first use in this function)
    util_pcre.c:133: error: 'PCRE_DOTALL' undeclared (first use in this function)
    util_pcre.c:136: warning: implicit declaration of function 'pcre_compile'
    util_pcre.c:136: warning: assignment makes pointer from integer without a cast
    util_pcre.c:142: warning: implicit declaration of function 'pcre_fullinfo'
    util_pcre.c:142: error: expected ')' before 'pcre'
    util_pcre.c:142: warning: type defaults to 'int' in declaration of 'type name'
    util_pcre.c:142: warning: cast from pointer to integer of different size
    util_pcre.c:143: error: 'PCRE_INFO_CAPTURECOUNT' undeclared (first use in this function)
    util_pcre.c: In function 'ap_regexec_len':
    util_pcre.c:180: error: 'PCRE_NOTBOL' undeclared (first use in this function)
    util_pcre.c:182: error: 'PCRE_NOTEOL' undeclared (first use in this function)
    util_pcre.c:198: warning: implicit declaration of function 'pcre_exec'
    util_pcre.c:198: error: expected ')' before 'pcre'
    util_pcre.c:198: warning: type defaults to 'int' in declaration of 'type name'
    util_pcre.c:198: warning: cast from pointer to integer of different size
    util_pcre.c:221: error: 'PCRE_ERROR_NOMATCH' undeclared (first use in this function)
    util_pcre.c:223: error: 'PCRE_ERROR_NULL' undeclared (first use in this function)
    util_pcre.c:225: error: 'PCRE_ERROR_BADOPTION' undeclared (first use in this function)
    util_pcre.c:227: error: 'PCRE_ERROR_BADMAGIC' undeclared (first use in this function)
    util_pcre.c:229: error: 'PCRE_ERROR_UNKNOWN_NODE' undeclared (first use in this function)
    util_pcre.c:231: error: 'PCRE_ERROR_NOMEMORY' undeclared (first use in this function)
    make[2]: *** [util_pcre.lo] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all-recursive] Error 1
    Any ideas what went wrong or what I should try next? The Apache install web page says:
    On some platforms, you may have to install the corresponding -dev package to allow httpd to build against your installed copy of PCRE. 
    But I can't find any information on where "the corresponding -dev package" can be downloaded.
    Thanks.

    Now I can't get a cgi script to execute.  Apache is returning the text of the script.  I've tried to follow exactly what the Apache CGI tutorial says here:
    http://httpd.apache.org/docs/2.0/howto/cgi.html#configuring
    I also followed the directions in the perl cgi script, printenv, that was included with Apache, and Apache returns the text, rather than executing the script.  Here is what the cgi-bin directory looks like:
    /usr/local/apache2/cgi-bin$ ls -al
    total 24
    drwxrwxrwx   5 root   admin   170 Feb 19 19:34 .
    drwxr-xr-x  15 root   admin   510 Feb 19 12:36 ..
    -rwxr-xr-x   1 7stud  admin   138 Feb 19 19:32 my.pl
    -rwxr-xr-x@  1 7stud  staff   687 Feb 19 19:03 printenv
    -rw-r--r--@  1 7stud  staff  1127 Sep  6  2008 test-cgi
    Here's what the printenv script looks like:
    /usr/local/apache2/cgi-bin$ cat printenv
    #!/usr/bin/env perl
    # To permit this cgi, replace # on the first line above with the
    # appropriate #!/path/to/perl shebang, and set this script executable
    # with chmod 755.
    # Note that it is subject to cross site scripting attacks on MS IE
    # and any other browser which fails to honor RFC2616, so never use
    # it in a live server environment, it is provided only for testing.
    ##  printenv -- demo CGI program which just prints its environment
    use strict;
    use warnings;
    print "Content-type: text/plain; charset=iso-8859-1\n\n";
    foreach my $var (sort(keys(%ENV))) {
        my $val = $ENV{$var};
        $val =~ s|\n|\\n|g;
        $val =~ s|"|\\"|g;
        print "${var}=\"${val}\"\n";
    Here's the url I used in my browser:
    http://localhost:8080/cgi-bin/printenv
    Here is my httpd.conf:
    # This is the main Apache HTTP server configuration file.  It contains the
    # configuration directives that give the server its instructions.
    # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
    # In particular, see
    # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
    # for a discussion of each configuration directive.
    # Do NOT simply read the instructions in here without understanding
    # what they do.  They're here only as hints or reminders.  If you are unsure
    # consult the online docs. You have been warned. 
    # Configuration and logfile names: If the filenames you specify for many
    # of the server's control files begin with "/" (or "drive:/" for Win32), the
    # server will use that explicit path.  If the filenames do *not* begin
    # with "/", the value of ServerRoot is prepended -- so "logs/access_log"
    # with ServerRoot set to "/usr/local/apache2" will be interpreted by the
    # server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log"
    # will be interpreted as '/logs/access_log'.
    # ServerRoot: The top of the directory tree under which the server's
    # configuration, error, and log files are kept.
    # Do not add a slash at the end of the directory path.  If you point
    # ServerRoot at a non-local disk, be sure to specify a local disk on the
    # Mutex directive, if file-based mutexes are used.  If you wish to share the
    # same ServerRoot for multiple httpd daemons, you will need to change at
    # least PidFile.
    ServerRoot "/usr/local/apache2"
    # Mutex: Allows you to set the mutex mechanism and mutex file directory
    # for individual mutexes, or change the global defaults
    # Uncomment and change the directory if mutexes are file-based and the default
    # mutex file directory is not on a local disk or is not appropriate for some
    # other reason.
    # Mutex default:logs
    # Listen: Allows you to bind Apache to specific IP addresses and/or
    # ports, instead of the default. See also the <VirtualHost>
    # directive.
    # Change this to Listen on specific IP addresses as shown below to
    # prevent Apache from glomming onto all bound IP addresses.
    #Listen 12.34.56.78:80
    Listen 8080
    # Dynamic Shared Object (DSO) Support
    # To be able to use the functionality of a module which was built as a DSO you
    # have to place corresponding `LoadModule' lines at this location so the
    # directives contained in it are actually available _before_ they are used.
    # Statically compiled modules (those listed by `httpd -l') do not need
    # to be loaded here.
    # Example:
    # LoadModule foo_module modules/mod_foo.so
    LoadModule authn_file_module modules/mod_authn_file.so
    #LoadModule authn_dbm_module modules/mod_authn_dbm.so
    #LoadModule authn_anon_module modules/mod_authn_anon.so
    #LoadModule authn_dbd_module modules/mod_authn_dbd.so
    #LoadModule authn_socache_module modules/mod_authn_socache.so
    LoadModule authn_core_module modules/mod_authn_core.so
    LoadModule authz_host_module modules/mod_authz_host.so
    LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
    LoadModule authz_user_module modules/mod_authz_user.so
    #LoadModule authz_dbm_module modules/mod_authz_dbm.so
    #LoadModule authz_owner_module modules/mod_authz_owner.so
    #LoadModule authz_dbd_module modules/mod_authz_dbd.so
    LoadModule authz_core_module modules/mod_authz_core.so
    LoadModule access_compat_module modules/mod_access_compat.so
    LoadModule auth_basic_module modules/mod_auth_basic.so
    #LoadModule auth_form_module modules/mod_auth_form.so
    #LoadModule auth_digest_module modules/mod_auth_digest.so
    #LoadModule allowmethods_module modules/mod_allowmethods.so
    #LoadModule file_cache_module modules/mod_file_cache.so
    #LoadModule cache_module modules/mod_cache.so
    #LoadModule cache_disk_module modules/mod_cache_disk.so
    #LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
    #LoadModule socache_dbm_module modules/mod_socache_dbm.so
    #LoadModule socache_memcache_module modules/mod_socache_memcache.so
    #LoadModule dbd_module modules/mod_dbd.so
    #LoadModule dumpio_module modules/mod_dumpio.so
    #LoadModule buffer_module modules/mod_buffer.so
    #LoadModule ratelimit_module modules/mod_ratelimit.so
    LoadModule reqtimeout_module modules/mod_reqtimeout.so
    #LoadModule ext_filter_module modules/mod_ext_filter.so
    #LoadModule request_module modules/mod_request.so
    #LoadModule include_module modules/mod_include.so
    LoadModule filter_module modules/mod_filter.so
    #LoadModule substitute_module modules/mod_substitute.so
    #LoadModule sed_module modules/mod_sed.so
    #LoadModule deflate_module modules/mod_deflate.so
    LoadModule mime_module modules/mod_mime.so
    LoadModule log_config_module modules/mod_log_config.so
    #LoadModule log_debug_module modules/mod_log_debug.so
    #LoadModule logio_module modules/mod_logio.so
    LoadModule env_module modules/mod_env.so
    #LoadModule expires_module modules/mod_expires.so
    LoadModule headers_module modules/mod_headers.so
    #LoadModule unique_id_module modules/mod_unique_id.so
    LoadModule setenvif_module modules/mod_setenvif.so
    LoadModule version_module modules/mod_version.so
    #LoadModule remoteip_module modules/mod_remoteip.so
    #LoadModule proxy_module modules/mod_proxy.so
    #LoadModule proxy_connect_module modules/mod_proxy_connect.so
    #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
    #LoadModule proxy_http_module modules/mod_proxy_http.so
    #LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
    #LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
    #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
    #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    #LoadModule proxy_express_module modules/mod_proxy_express.so
    #LoadModule session_module modules/mod_session.so
    #LoadModule session_cookie_module modules/mod_session_cookie.so
    #LoadModule session_dbd_module modules/mod_session_dbd.so
    #LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
    #LoadModule ssl_module modules/mod_ssl.so
    #LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
    #LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
    #LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
    #LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
    LoadModule unixd_module modules/mod_unixd.so
    #LoadModule dav_module modules/mod_dav.so
    LoadModule status_module modules/mod_status.so
    LoadModule autoindex_module modules/mod_autoindex.so
    #LoadModule info_module modules/mod_info.so
    #LoadModule cgid_module modules/mod_cgid.so
    #LoadModule dav_fs_module modules/mod_dav_fs.so
    #LoadModule vhost_alias_module modules/mod_vhost_alias.so
    #LoadModule negotiation_module modules/mod_negotiation.so
    LoadModule dir_module modules/mod_dir.so
    #LoadModule actions_module modules/mod_actions.so
    #LoadModule speling_module modules/mod_speling.so
    #LoadModule userdir_module modules/mod_userdir.so
    LoadModule alias_module modules/mod_alias.so
    #LoadModule rewrite_module modules/mod_rewrite.so
    <IfModule unixd_module>
    # If you wish httpd to run as a different user or group, you must run
    # httpd as root initially and it will switch. 
    # User/Group: The name (or #number) of the user/group to run httpd as.
    # It is usually good practice to create a dedicated user and group for
    # running httpd, as with most system services.
    User daemon
    Group daemon
    </IfModule>
    # 'Main' server configuration
    # The directives in this section set up the values used by the 'main'
    # server, which responds to any requests that aren't handled by a
    # <VirtualHost> definition.  These values also provide defaults for
    # any <VirtualHost> containers you may define later in the file.
    # All of these directives may appear inside <VirtualHost> containers,
    # in which case these default settings will be overridden for the
    # virtual host being defined.
    # ServerAdmin: Your address, where problems with the server should be
    # e-mailed.  This address appears on some server-generated pages, such
    # as error documents.  e.g. [email protected]
    ServerAdmin [email protected]
    # ServerName gives the name and port that the server uses to identify itself.
    # This can often be determined automatically, but we recommend you specify
    # it explicitly to prevent problems during startup.
    # If your host doesn't have a registered DNS name, enter its IP address here.
    ServerName 7stud.com
    # Deny access to the entirety of your server's filesystem. You must
    # explicitly permit access to web content directories in other
    # <Directory> blocks below.
    <Directory />
        AllowOverride none
        Require all denied
    </Directory>
    # Note that from this point forward you must specifically allow
    # particular features to be enabled - so if something's not working as
    # you might expect, make sure that you have specifically enabled it
    # below.
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    DocumentRoot "/usr/local/apache2/htdocs"
    <Directory "/usr/local/apache2/htdocs">
        # Possible values for the Options directive are "None", "All",
        # or any combination of:
        #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
        # Note that "MultiViews" must be named *explicitly* --- "Options All"
        # doesn't give it to you.
        # The Options directive is both complicated and important.  Please see
        # http://httpd.apache.org/docs/2.4/mod/core.html#options
        # for more information.
        Options Indexes FollowSymLinks
        # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   Options FileInfo AuthConfig Limit
        AllowOverride None
        # Controls who can get stuff from this server.
        Require all granted
    </Directory>
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    <IfModule dir_module>
        DirectoryIndex index.html
    </IfModule>
    # The following lines prevent .htaccess and .htpasswd files from being
    # viewed by Web clients.
    <Files ".ht*">
        Require all denied
    </Files>
    # ErrorLog: The location of the error log file.
    # If you do not specify an ErrorLog directive within a <VirtualHost>
    # container, error messages relating to that virtual host will be
    # logged here.  If you *do* define an error logfile for a <VirtualHost>
    # container, that host's errors will be logged there and not here.
    ErrorLog "logs/error_log"
    # LogLevel: Control the number of messages logged to the error_log.
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn
    <IfModule log_config_module>
        # The following directives define some format nicknames for use with
        # a CustomLog directive (see below).
        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
        LogFormat "%h %l %u %t \"%r\" %>s %b" common
        <IfModule logio_module>
          # You need to enable mod_logio.c to use %I and %O
          LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
        </IfModule>
        # The location and format of the access logfile (Common Logfile Format).
        # If you do not define any access logfiles within a <VirtualHost>
        # container, they will be logged here.  Contrariwise, if you *do*
        # define per-<VirtualHost> access logfiles, transactions will be
        # logged therein and *not* in this file.
        CustomLog "logs/access_log" common
        # If you prefer a logfile with access, agent, and referer information
        # (Combined Logfile Format) you can use the following directive.
        #CustomLog "logs/access_log" combined
    </IfModule>
    <IfModule alias_module>
        # Redirect: Allows you to tell clients about documents that used to
        # exist in your server's namespace, but do not anymore. The client
        # will make a new request for the document at its new location.
        # Example:
        # Redirect permanent /foo http://www.example.com/bar
        # Alias: Maps web paths into filesystem paths and is used to
        # access content that does not live under the DocumentRoot.
        # Example:
        # Alias /webpath /full/filesystem/path
        # If you include a trailing / on /webpath then the server will
        # require it to be present in the URL.  You will also likely
        # need to provide a <Directory> section to allow access to
        # the filesystem path.
        # ScriptAlias: This controls which directories contain server scripts.
        # ScriptAliases are essentially the same as Aliases, except that
        # documents in the target directory are treated as applications and
        # run by the server when requested rather than as documents sent to the
        # client.  The same rules about trailing "/" apply to ScriptAlias
        # directives as to Alias.
        ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/
    </IfModule>
    <IfModule cgid_module>
        # ScriptSock: On threaded servers, designate the path to the UNIX
        # socket used to communicate with the CGI daemon of mod_cgid.
        #Scriptsock cgisock
    </IfModule>
    # "/usr/local/apache2/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    <Directory "/usr/local/apache2/cgi-bin">
        AllowOverride None
        Options None
        Require all granted
    </Directory>
    <IfModule mime_module>
        # TypesConfig points to the file containing the list of mappings from
        # filename extension to MIME-type.
        TypesConfig conf/mime.types
        # AddType allows you to add to or override the MIME configuration
        # file specified in TypesConfig for specific file types.
        #AddType application/x-gzip .tgz
        # AddEncoding allows you to have certain browsers uncompress
        # information on the fly. Note: Not all browsers support this.
        #AddEncoding x-compress .Z
        #AddEncoding x-gzip .gz .tgz
        # If the AddEncoding directives above are commented-out, then you
        # probably should define those extensions to indicate media types:
        AddType application/x-compress .Z
        AddType application/x-gzip .gz .tgz
        # AddHandler allows you to map certain file extensions to "handlers":
        # actions unrelated to filetype. These can be either built into the server
        # or added with the Action directive (see below)
        # To use CGI scripts outside of ScriptAliased directories:
        # (You will also need to add "ExecCGI" to the "Options" directive.)
        #AddHandler cgi-script .cgi
        # For type maps (negotiated resources):
        #AddHandler type-map var
        # Filters allow you to process content before it is sent to the client.
        # To parse .shtml files for server-side includes (SSI):
        # (You will also need to add "Includes" to the "Options" directive.)
        #AddType text/html .shtml
        #AddOutputFilter INCLUDES .shtml
    </IfModule>
    # The mod_mime_magic module allows the server to use various hints from the
    # contents of the file itself to determine its type.  The MIMEMagicFile
    # directive tells the module where the hint definitions are located.
    #MIMEMagicFile conf/magic
    # Customizable error responses come in three flavors:
    # 1) plain text 2) local redirects 3) external redirects
    # Some examples:
    #ErrorDocument 500 "The server made a boo boo."
    #ErrorDocument 404 /missing.html
    #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
    #ErrorDocument 402 http://www.example.com/subscription_info.html
    # MaxRanges: Maximum number of Ranges in a request before
    # returning the entire resource, or one of the special
    # values 'default', 'none' or 'unlimited'.
    # Default setting is to accept 200 Ranges.
    #MaxRanges unlimited
    # EnableMMAP and EnableSendfile: On systems that support it,
    # memory-mapping or the sendfile syscall may be used to deliver
    # files.  This usually improves server performance, but must
    # be turned off when serving from networked-mounted
    # filesystems or if support for these functions is otherwise
    # broken on your system.
    # Defaults: EnableMMAP On, EnableSendfile Off
    #EnableMMAP off
    #EnableSendfile on
    # Supplemental configuration
    # The configuration files in the conf/extra/ directory can be
    # included to add extra features or to modify the default configuration of
    # the server, or you may simply copy their contents here and change as
    # necessary.
    # Server-pool management (MPM specific)
    #Include conf/extra/httpd-mpm.conf
    # Multi-language error messages
    #Include conf/extra/httpd-multilang-errordoc.conf
    # Fancy directory listings
    #Include conf/extra/httpd-autoindex.conf
    # Language settings
    #Include conf/extra/httpd-languages.conf
    # User home directories
    #Include conf/extra/httpd-userdir.conf
    # Real-time info on requests and configuration
    #Include conf/extra/httpd-info.conf
    # Virtual hosts
    #Include conf/extra/httpd-vhosts.conf
    # Local access to the Apache HTTP Server Manual
    #Include conf/extra/httpd-manual.conf
    # Distributed authoring and versioning (WebDAV)
    #Include conf/extra/httpd-dav.conf
    # Various default settings
    #Include conf/extra/httpd-default.conf
    # Configure mod_proxy_html to understand HTML4/XHTML1
    <IfModule proxy_html_module>
    Include conf/extra/proxy-html.conf
    </IfModule>
    # Secure (SSL/TLS) connections
    #Include conf/extra/httpd-ssl.conf
    # Note: The following must must be present to support
    #       starting without SSL on platforms with no /dev/random equivalent
    #       but a statically compiled-in mod_ssl.
    <IfModule ssl_module>
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    </IfModule>
    # Deal with user agents that deliberately violate open standards
    <IfModule setenvif_module>
    BrowserMatch "MSIE 10.0;" bad_DNT
    </IfModule>
    <IfModule headers_module>
    RequestHeader unset DNT env=bad_DNT
    </IfModule>

  • Dymo labels javascript (API) issue

    Hi all.
    APEX 4.2
    11gR2 XE database.
    I'm trying to print labels directly from APEX via a JS library from DYMO (DYMO label framework for javascript).
    I would like to fetch the XML for the label layout dynamically from the database instead of fixed assigning this in JS, that way I can store all the templates for labels in the database and fetch the appropriate one for the task I'm doing ).
    If I use the fixed code it works fine, code looks like this ( label XML layout is assigned to labelxml variable in the first few lines ) :
    function printadres(labeltext )
        try
    var labelxml = '<?xml version="1.0" encoding="utf-8"?>\
        <DieCutLabel Version="8.0" Units="twips">\
            <PaperOrientation>Landscape</PaperOrientation>\
            <Id>Address</Id>\
            <PaperName>30252 Address</PaperName>\
            <DrawCommands/>\
            <ObjectInfo>\
                <TextObject>\
                    <Name>Text</Name>\
                    <ForeColor Alpha="255" Red="0" Green="0" Blue="0" />\
                    <BackColor Alpha="0" Red="255" Green="255" Blue="255" />\
                    <LinkedObjectName></LinkedObjectName>\
                    <Rotation>Rotation0</Rotation>\
                    <IsMirrored>False</IsMirrored>\
                    <IsVariable>True</IsVariable>\
                    <HorizontalAlignment>Left</HorizontalAlignment>\
                    <VerticalAlignment>Middle</VerticalAlignment>\
                    <TextFitMode>ShrinkToFit</TextFitMode>\
                    <UseFullFontHeight>True</UseFullFontHeight>\
                    <Verticalized>False</Verticalized>\
                    <StyledText/>\
                </TextObject>\
                <Bounds X="332" Y="150" Width="4455" Height="1260" />\
            </ObjectInfo>\
        </DieCutLabel>';
              var label = dymo.label.framework.openLabelXml(labelxml);
              // set label text
              label.setObjectText("Text", labeltext);
              // select printer to print on
              // for simplicity sake just use the first LabelWriter printer
              var printers = dymo.label.framework.getPrinters();
              if (printers.length == 0)
                   throw "No DYMO printers are installed. Install DYMO printers.";
              var printerName = "";
              for (var i = 0; i < printers.length; ++i)
                   var printer = printers;
                   if (printer.printerType == "LabelWriterPrinter")
                        printerName = printer.name;
                        break;
              if (printerName == "")
                   throw "No LabelWriter printers found. Install LabelWriter printer";
              // finally print the label
              label.print(printerName);
         catch(e)
              alert(e.message || e);
    but when I try to fetch the same XML from a text field on my form it fails with a "getObjectByNameElement(): no object with name 'Text' was found" error which is a custom error from the DYMO library.
    I'm unable to find the big difference in the 2 approaches. If I test the variable labelxml by putting it in an alert the value seems fine ( it contains the XML string which is in P11_LABELTEMPLATE which is exactly the same as the static assigned text in the previous example ).
    The code then looks like this :function printadres(labeltext )
    try
              var labelxml = $v('P11_LABELTEMPLATE'); // This is the dynamic assigment which somehow fails
              var label = dymo.label.framework.openLabelXml(labelxml);
              // set label text
              label.setObjectText("Text", labeltext);
              // select printer to print on
              // for simplicity sake just use the first LabelWriter printer
              var printers = dymo.label.framework.getPrinters();
              if (printers.length == 0)
                   throw "No DYMO printers are installed. Install DYMO printers.";
              var printerName = "";
              for (var i = 0; i < printers.length; ++i)
                   var printer = printers[i];
                   if (printer.printerType == "LabelWriterPrinter")
                        printerName = printer.name;
                        break;
              if (printerName == "")
                   throw "No LabelWriter printers found. Install LabelWriter printer";
              // finally print the label
              label.print(printerName);
         catch(e)
              alert(e.message || e);
    I'm not sure if this is an APEX or JS question/problem but I hope someone can point me in the right direction.
    Regards
      Bas                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hello Bas,
    >> P11_LABELTEMPLATE
    There is a possibility that the actual value of P11_LABELTEMPLATE is escaped. Try to use the Session popup window to check the value of the item.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

Maybe you are looking for