Acrobat binding edge - duplex or otherwise?

I'm not a regular user of Acrobat Pro, though v.6 (on my machine) and v.9 (on a colleague's) are available to me.  So when I was trying to print a longish (100+ pages) document double-sided, with a binding edge, I assumed that my inability to find the binding edge setting was just a matter of my ignorance.  Hours later, though, after searching the Help, then web search, then searching this forum, I'm not so sure that the ignorance is mine.  Could someone tell me how to se a binding edge - of any kind - in Acrobat? - and then, how to set up double-sided printing with a mirrored binding edge? [There is a selection in the "Adobe PDF Settings" pane of Acrobat Distiller and the Adobe PDF Printer driver - both of which are inapplicable to the Acrobat problem - but even that is just a "Left edge" or "Right edge" selection, not a binding edge setting, and lacks a duplex/mirrored option.]    I can't believe this common function is missing from something as mature as Acrobat. Is it?

Thanks for your reply.  Fortunately I decided to come back to the web forum to check, and found that the answer I sent hours ago - in reply to email - did not register for some reason.  I don't know why that is, but I'm sorry for the delay, and have learned not to believe the email footer that says, "To post a reply to the thread message, either reply to this email or visit the message page: http://forums.adobe.com/message/2352913#2352913."  Apparently "reply to this email" is not to be believed - it only registers that something was sent, not what was sent.  Anyway, here is the content of that reply:
Bill@VT wrote:
You can't in the manner you are trying to do it. ... use the crop tool to reset the margins that are used and apply the result to either even or odd only pages. Then print the end result...
Actually, I did use the Crop tool as the first step of this process, which is to make a 2-sided hardcopy of what was scanned from a 1-sided hardcopy. [It was a poor scan of a poorly printed document - complicating factors - but the file came from an office over which I have no control, so I deal with the complications as needed.]
The first crop was .75" from the left edge, to eliminate black hole-punch circles.  That leaves a document of 146 pages, each cropped .75" on the left to 7.75" x 11", with the text then roughly centered.  Now I would like to return the pages to 8.5" x 11", but with the binding edge restored to the left side for odd pages and to the right side for even pages.  Does the Crop tool help further with that objective?
Thanks again,
John

Similar Messages

  • Acrobat "forgets" about duplex mode

    I am using Acrobat X Pro on an Intel MacBookPro with OS 10.6.8. I have a networked HP ColorLaserJet 5550dn printer with duplex unit which works just fine in any other application. If I have a multi-page .pdf document I want to print from Acrobat (or, for that matter, Reader!), I get the Acrobat dialog box instead of the standard Mac one. Of course, it doesn't have a "duplex" option, so I click on the "Printer..." button in their dialog box. I can then set up duplex printing and it works just fine. Here is the problem: The next time I start Acrobat and print the VERY SAME DOCUMENT, it comes out single-sided, wasting paper. This is true even if I do NOTHING in between (no other print jobs etc.). In other words, by layering their proprietory print dialog box over the Mac one, apparently Acrobat is incapable of "remembering" from one print incident to the next to submit the Duplex command. Strangely, if I simply go through the chain "Print" -> press the "Printer..." button in the dialog box, I see that duplex is still selected, and if I then simply click "Print" in both the Mac and the Acrobat dialog boxes, everthing works as expected - twosided output. So going through the Mac printer dialog box apparently "jogs the memory". Ironically, by default you get a WARNING when clicking on the "Printer..." button in the Acrobat dialog box!
    So, for now I'll have to remember to jump through the extra hoops every time or I'll waste more trees. BTW, a nearly 1-hour long "chat" with Adobe Support didn't resolve the problem, but messed up some more things instead.

    O.k., this works indeed for this ONE document (if I save it after changing its properties). However, I rarely print the same file twice - my problem is printing out files sent to me by others (who may not know about this property) and having to remember each time to jump through some extra hoops (either clicking the "Printer..." button or your suggestion). So the only true solution would be if I could somehow teach Acrobat to print ALL files as duplex by default (or, like all other Mac applications that use the Mac Printing interface, use whatever printer settings were used last unless specifically changed).

  • Adobe Reader und Adobe Acrobat drucken bei Duplex nicht doppelseitig

    Hallo Leute,
    vor einem halben Jahr hatte ich das Problem, daß Adobe Reader (7.1.4) nicht doppelseitig druckte, obwohl ich einen Duplex-Drucker benutze. Alle anderen Programme – einschl. Adobe Acrobat Professionell (7.1.4) – druckten doppelseitig.
    So verglich ich die AVGeneral-Einträge vom Adobe Reader (7.1.4) und Adobe Acrobat Professionell (7.1.4) und stellte dabei fest, daß der Eintrag »bprintAutoRotate« auf 0 stand, obwohl er auf 1 hätte stehen müssen. Auch den Eintrag »bprintSetPageSize« mußte ich von 1 auf 0 ändern. Danach konnte ich wieder mit dem Adobe Reader (7.1.4) drucken.
    Nun habe ich das Problem wieder – diesmal aber mit dem Adobe Reader (7.1.4) und dem Adobe Acrobat Professionell (7.1.4). Die oben genannten Einstellungen waren nun bei beiden falsch, ich änderte diese, machte einen Neustart, überprüfte die Einträge (die noch richtig waren), druckte aus – und wieder nichts. Die Seiten werden einseitig bedruckt. Schaue ich dann in die Registry, sind die Werte wieder falsch. Korrigiere ich die Werte (und mache natürlich einen Neustart), sind die Werte jedesmal nach einem Druckvorgang wieder falsch bzw. beim Drucken wurde nur einseitig gedruckt.
    Mit NitroPDF lassen sich meine PDFs nach wie vor doppelseitig ausdrucken, doch wie kommt dieses aktuelle Phänomen zustande? (Betriebssystem: WinXP-SP3)

    Darf ich vorschlagen, dass Sie entweder einen Übersetzer wie Google verwenden, oder posten Sie Ihre Fragen im Forum in Deutsch: http://forums.adobe.com/community/international_forums/deutsche
    May I suggest that you either use a translator such as Google's, or post your questions in the Forum in German?

  • Acrobat 9 Pro, making edge of book scanning pages darker

    Thank you for reading my post,
       I am using Acrobat 9 Pro with Windows Vista to scan a hardcover book. Since it is hardcover, it is hard to press enough to get a good scan on the end of the pages, so I get light letters that I would like to get darker. So far I have not found a way to do this inside of Acrobat, so at the moment I am extracting the troubled pages out of the document, use photoshop's burn tool over the light end areas, saving the page and adding it to the main document. Even though this works, it is extremely labor intensive. There have to be a better and easier way! Any ideas?
    Book was scanned (not OCR) at 300 resolution with scanner CanoScan LiDE700F
        I still have several pages to correct so your help would be greatly appreciated,
    Jordan

    Something to play with:
    Acrobat provides "Edge shadow removal"
    (the dark edge produced when what is scanned is not flush between platen and cover of scanner.
    Try a setting of "Aggressive".
    In Acrobat 8 - File > Create PDF > From Scanner
    In the Acrobat Scan dialog, Document pane - click the Options button for 'Optimization'.
    This brings up the dialog that contains settings for Filtering.
    Alternatively, click Document > Optimize Scanned PDF
    The associated dialog provides for user configuration of Filtering settings.
    Similar approach for Acrobat 9.
    However,  for File > Create PDF > From Scanner click on "Configure Presets".
    The Document > Optimize Scanned PDF for Acrobat 9 is similar to Acrobat 8.
    Be well...

  • Duplex printing option no longer avaialble in Preview and TextEdit.

    I am no longer offered the option to select two-sided printing for .pdfs in Preview or for text documents in TextEdit when using my HP Officejet K550. The printing options no longer allow me to select Paper Type or Print Quality for these documents either. If I open a the same .pdf in Adobe Reader or Acrobat Pro, the duplex, paper, and quality options are available. I have the latest driver and firmware updates from HP, and my Apple software is up to date. HP Support suggests it is an issue with the applications from which I'm printing (e.g. Preview).
    Does anybody know why this has happened or how to restore these options when printing from Preview or TextEdit?
    Intel iMac   Mac OS X (10.4.9)  

    Since you are using an Intel Mac, the two applications you mention have been written in Universal Binary. For your HP printer driver, if it relies on print dialog extensions (pde's) to make these options available, and these same files have been written for the older Power PC processor, then this can make the options unavailable when printing from Universal applications. And that could explain why they are available when printing from Acrobat, as this is probably still the PPC version.
    The solution would be to find a Universal version of the HP driver (I know you mentioned you have the latest but if its not Universal then it will have this issue).
    To prove it is a Universal vs PPC issue, you can change Preview so that it opens using the Rosetta emulator. Control-click on the Preview icon and select Get Info. Select the check box "Open using Rosetta" and then close the window. Then open Preview and try to print two-sided.

  • HP LaserJet 4200 Duplexing Issue

    I have a LJ 4200 with the duplexer. I can to long-edge duplexing without a problem, however, when I try to do short-edge duplexing the image on the page gets cut off 2/3 the way across the page.
    All of my software is up to date, and I have the latest printer drivers installed.
    Any ideas?

    Is the computer it was installed on connected to the wireless network?
    The computer being connected by Ethernet to the network is the most likely cause of the issue you are experiencing.  
    What brand and model is the router?
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • Acrobat 9 Pro Book Recommendations wanted

    We will soon be install CS4 which comes with Acrobat 9 Pro.
    I am look for recommendation of book(s) which would be a useful resource for learning the features of Acrobat 9 Pro.
    Thanks

    Something to play with:
    Acrobat provides "Edge shadow removal"
    (the dark edge produced when what is scanned is not flush between platen and cover of scanner.
    Try a setting of "Aggressive".
    In Acrobat 8 - File > Create PDF > From Scanner
    In the Acrobat Scan dialog, Document pane - click the Options button for 'Optimization'.
    This brings up the dialog that contains settings for Filtering.
    Alternatively, click Document > Optimize Scanned PDF
    The associated dialog provides for user configuration of Filtering settings.
    Similar approach for Acrobat 9.
    However,  for File > Create PDF > From Scanner click on "Configure Presets".
    The Document > Optimize Scanned PDF for Acrobat 9 is similar to Acrobat 8.
    Be well...

  • How to use JDBC Positional Binding Style & ExecuteWithParams?

    Can anyone provide any help here including any documentation on how to configure this (I've checked online help and the developer guide.)
    When defining multiple Bind Position variables on a View Object (using sql statement binding style: JDBC Positional), should I defined multiple bind variable names? Otherwise, if I don't, when I use ExecuteWithParams operation to create the data control, only one input variable field is displayed. I can get a single bind position variable to work, but am struggling on how to configure / get multiple bind position variables to work with ExecuteWithParams.
    Here's my current configuration:
    1. Define View Object with two JDBC Positional Binding Parameters
    -- Bind Variables: name=parm1 (???should I define a second bind variable name???)
    -- Bind Positions = 0,1
    -- SQL Statement add another position var in where clause: "match (zip) against (CONCAT(?,'*') IN BOOLEAN MODE) and "match (name) against (CONCAT(?,'*') IN BOOLEAN MODE)
    2. On a JSF page, drag ExecuteWithParams operation from data control onto the JSF page. If I have defined only one bind variable name, only one input field is displayed (and one field label that I defined for that bind variable), but I need two input fields - one for each bind position variable. How do I set this up?
    Back-end Database is MySQL 5.0.1 which is why I am using binding stye JDBC positional.
    Thanks, Tom
    Message was edited by:
    javaX

    I did some more testing and the problem is that the queries work with one bind position variable but not with two. I created two simple view objects off of the same entity object to test:
    #1 - ViewObject with one bind position variable - where clause: where id > ?
    #2 - ViewObject with two bind position variables - where clause: where id > ? and id < ?
    I created two separate .jspx pages, view1.jspx (one input field) and view2.jspx (two input fields), for each view object by dragging ExecuteWithParams operation onto the JSF page.
    The .jspx page with one input field works (returns result sets.) The view2.jspx page with two input fields does not work - the query does not return any result sets (no errors produced, it just does not return any rows) - I've tested my query outside of jdeveloper and it works fine. I also tried switching my inputs to make sure I did not have an illogical query (i.e., id >100 and id< 1).
    Is there anything different / extra I need to do to use two bind position variables?
    I'm STUCK HERE.
    Everything in this simple test was identical except for using 2 input variables versus 1.
    Technology stack is: jdeveloper 10.1.3, jsf/ADF BC, mySQL 5.01
    Since I now understand what the problem is better, I'm going to re-post this as a new topic that more appropriately describes the problem, "Queries not working with multiple bind position variables?"
    Message was edited by:
    javaX

  • Query Bind Parameters and LOV's [JHS 10.1.3.1]

    Using the JHeadstart Developer's Guide instructions (starting section 3-69) I have started to learn and then implement Query Bind Parameters in JHeadstart - but I am being met with nothing but troubles.
    Is there anything 'special' that I have to do in order to get a query bind parameter to work with a LOV? I have followed the instructions in the Developer's Guide but just replaced the bind parameters that would otherwise be in a Dynamic Domain into a LOV group in the JHeadstart Application Definition file..
    To be precise about all of this, I have been trying to get this to work with the HR database schema. So, like in the mini-tutorial I have a query bind parameter on a Employee table View Object set as a LOV to the ManagerId field on the Departments View Object (set in Form View).
    What is actually happening when I open up my LOV, is that no rows are ever displayed in the LOV pop-up window.
    What am I doing wrong?

    Michael,
    Take a look at this thread:
    Re: Group Used as LOV does not return records
    You have to use a managed bean to "communicate" the value of the Employees base page to the LOV page definition.
    Steven Davelaar,
    Jheadstart Team.

  • Adobe acrobat 7 professional

    can I remove adobe acrobat x standard and install adobe acrobat 7 on Windows 7

    if you own a license for acrobat 7 pro, yes.  otherwise, no.
    you may need to install using compatibility mode.

  • Acrobat 10.1.7 crash on quit on 10.7.5

    Hello,
    I've experience frequent Acrobat crash on quit when running under Lion 10.7.5. I have refresh the Acrobat prefences as suggested in previous discussions. Still no dice.
    Crash report: http://pastebin.com/GPAcAnxC
    Anyone can help?
    Thanks
    T

    I was experiencing very similar behavior in Safari and Firefox. 
    What I did and it seems to have worked was this:
    1.  Updated to Safari 5.1.5 ( http://www.apple.com/safari/download/ ).  If you were like me you never updated to the Safari 5.1.x versions because you would lose the ability to work with Acrobat and Reader within Safari otherwise.
         a.  If you read the 10.1.3 Release Notes Safari 5.1.x is now supported.
    http://helpx.adobe.com/content/dam/help/attachments/Acrobat_Reader_ReleaseNote_10.1.3.pdf
    10.1.3
    Added support for:
    • Firefox 10.0.x
    • Apple Safari 5.1 (64 bit) for OSX 10.6.8, Apple Safari 5.1(32-bit and 64-bit) for OSX 10.7.x
    Dropped support for:
    • All versions of Firefox prior to 10.0.
    2.  Reboot required by the Safari 5.1.5 installation
    3.  Opened both Safari and Firefox and both are stable now.
    Odd behavior I would agree.
    *Note:  You may lose some plugin functionality because when I looked in the /Library/Internet Plug-ins/ folder the only one that was there was a WebEx plug-in.  Everything else got moved out of that folder.

  • Cannot print duplex w/ tiger

    I have a new G5 running OSX V10.4.6. My printer is an HP laserjet 5500dtn with duplex capability, which no longer works with my new machine. Duplex option does not appear in print window. Have done printer setup multiple times using both manual and automatic option selection. In all cases, "duplex" is checked in printer setup window, but does not appear as an option when printing in the "copies &pages" pop-up. Have now also installed most recent HP drivers (only a few months old), but still no luck. Also, "rosetta" option (another recommended fix) does not seem to be available in "get info" windows. Please help.
    Thanks,
    Stewart

    I looked at the PPD for the LJ 1320 and did find this section:
    *%=================================================
    *% Duplex
    *%=================================================
    *OpenUI *Duplex/Duplex: PickOne
    *OrderDependency: 50 AnySetup *Duplex
    *DefaultDuplex: None
    *Duplex None/Off (1-Sided): "
    <</Duplex false>> setpagedevice"
    *End
    *Duplex DuplexNoTumble/Flip on Long Edge (Standard): "
    <</Duplex true /Tumble false>> setpagedevice"
    *End
    *Duplex DuplexTumble/Flip on Short Edge: "
    <</Duplex true /Tumble true>> setpagedevice"
    *End
    *?Duplex: "
    save
    currentpagedevice /Duplex known
    false ne
    { currentpagedevice /Duplex get
    { currentpagedevice /Tumble get
    {(DuplexTumble)}{(DuplexNoTumble)}ifelse
    } { (None)} ifelse
    }{(None)} ifelse = flush
    restore
    *End
    *CloseUI: *Duplex
    which indicates that there is something there for duplex printing. This seems to be the corresponding section for my printer, where duplexing works just fine:
    *OpenUI *Duplex/Duplex: PickOne
    *OrderDependency: 50 AnySetup *Duplex
    *DefaultDuplex: None
    *Duplex None/Off: "<</Duplex false>>setpagedevice"
    *Duplex DuplexNoTumble/Long Edge: "<</Duplex true /Tumble false>>setpagedevice"
    *Duplex DuplexTumble/Short Edge: "<</Duplex true /Tumble true>>setpagedevice"
    *?Duplex: "
    save
    currentpagedevice /Duplex get
    {currentpagedevice /Tumble get
    {(DuplexTumble)}{(DuplexNoTumble)}ifelse
    }{(None)}ifelse = flush
    restore
    *End
    *CloseUI: *Duplex
    It seems to be pretty similar. Now with my printer, the setup utility can detect that the duplex device is present, but that may not be the case for yours, in which case you need to set it as an installable option, either through the Printer Setup Utility, or through the CUPS system, http://127.0.0.1:631/printers where you click on Configure Printer, type in a short administrator name (an oxymoron in my case!) and password, and then you will be able to tell the system that duplex is installed.
    Of course, that still would not mean that HP has not gotten the PPD wrong, which has happened in the past. I remember I had a problem with my 6MP, which I reported and actually got a call back from someone who had one on his desk and could repeat the problem.

  • I would like to set my preferences so that documents always print double-sided without having to click anything other than "print".

    I'm trying to set my preferences so that all documents print double-sided automatically without my having to remember to click the "Print on both sides of paper" button.  I print literally thousands of PDF files!  Duplexed.  How do I set this as a preference?  PS: I work on a MAC OS X and I have Adobe Acrobat X 10.1.12.

    I'm not trying to set the printer preferences, I'm trying to set the
    Adobe Acrobat Printer defaults.  If I don't click on "Print on both
    sides of paper" in the Acrobat Print box, then that overrides my printer
    default and prints the document single sided.  In the "good old days" I
    just chose "Duplex" under "Advanced" and then Acrobat would
    automatically duplex all my print jobs until I chose otherwise.  Now,
    duplex is not an option under Advanced....  I was hoping it had just
    been moved elsewhere.

  • Problem with jsp and controller

    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
    <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
    <%@ page import='com.uk.nhs.training.data.ActivityMatrix'%>
    <SCRIPT language="JavaScript" type="text/javascript">
    function bookActivity()
    if (document.bookActivityController.activitySelect.selectedIndex == 0)
    alert("Please Select Activity");
    else if (document.bookActivityController.trainerId.selectedIndex == 0)
    alert ( "Please Select Trainer");
    else if(document.bookActivityController.fromDate.value=="")
    alert("Please supply the Start Date of Activity")
    else
    validateForExistingCourses();
    function validateForExistingCourses()
    flag="wait";
    var trainerId=document.getElementById("trainerId").value;
    var fromDate=document.getElementById("fromDate").value;
    var toDate=document.getElementById("toDate").value;
    var activityId=document.getElementById("activitySelect").value;
    url="ajaxList.htm?actionType=checkBookedCoursesActivities&trainerId="+trainerId+"&fromDate="+fromDate+"&toDate="+toDate+"&activitySelect="+activityId;
    what = "checkForPreBookedCoursesActivities(req.responseXML)";
    doCallback(null);
    function checkForPreBookedCoursesActivities(theXmlResponse)
    // alert("in here in checking prebookedCourses");
    if(theXmlResponse != null)
         var isActivityExisting = theXmlResponse.getElementsByTagName('existingActivity')[0].text;
         var isCourseExisting = theXmlResponse.getElementsByTagName('existingbookedcourse')[0].text;     
              if(isActivityExisting=="Y")
              alert("Activity You are trying to book for Trainer already exists");
              return false;
              else if(isCourseExisting=="Y")
              if(confirm('Conflict Message. The dates choosen conflict with a current booking. Do you want to override'))
    window.open("/training1.1/secure/prebookedEvents.htm","clientwindow",'StatusBar', 'toolbar=yes,resizable=yes,scrollbars=yes,width=500,height=400,left=0,top=0');
    return false;
    else
    document.bookActivityController.action="/training1.1/secure/bookActivityTrainer.htm?actionType=submitForm";
    document.bookActivityController.submit();
    function goHomePage()
         window.location="/training1.1/secure/welcome.htm";
    function showHideAmPm(divId)
    if(document.bookActivityController.halfday.checked==true)
    showDiv(divId);
    else
    hideDiv(divId);
    function showDiv(divId)
    var item = document.getElementById(divId);
    alert("show item"+item);
    if (item)
    item.className='unhidden';
    function hideDiv(divId)
    var item = document.getElementById(divId);
    alert("unhide item"+item);
    if (item)
    item.className='hidden';
    function getActivitiesPm()
    if(document.bookActivityController.am.checked==true)
    document.bookActivityController.pm.checked=false;
    flag="wait";
         url="ajaxList.htm?actionType=activities&keyword=PM";
         what = "setActivities(req.responseXML)";
         doCallback(null);
         document.bookActivityController.activityTimeSelect.value="halfday";
         document.bookActivityController.activityTimeSubType.value="pm";
         // alert("subType"+document.bookActivityController.activityTimeSubType.value);
    function getActivitiesAm()
    if(document.bookActivityController.pm.checked==true)
    document.bookActivityController.am.checked=false;
    flag="wait";
         url="ajaxList.htm?actionType=activities&keyword=AM";
         what = "setActivities(req.responseXML)";
         doCallback(null);
         document.bookActivityController.activityTimeSelect.value="halfday";
         document.bookActivityController.activityTimeSubType.value="pm";
    function getSingleDayActivities()
    if(document.bookActivityController.singleday.checked==true)
    document.bookActivityController.moredays.checked=false;
    document.bookActivityController.halfday.checked=false;
    hideDiv('partofhalfday');
    document.bookActivityController.activityTimeSelect.value="fullday";
    flag="wait";
         url="ajaxList.htm?actionType=activities&keyword=FullDay";
         what = "setActivities(req.responseXML)";
         doCallback(null);
    else
    hideDiv('activitySelect');
    function getMoreDaysActivities()
    alert();
    if(document.bookActivityController.moredays.checked==true)
    document.bookActivityController.singleday.checked=false;
    document.bookActivityController.halfday.checked=false;
    hideDiv('partofhalfday');
    document.bookActivityController.activityTimeSelect.value="moredays";
    flag="wait";
         url="ajaxList.htm?actionType=activities&keyword=FullDay";
         what = "setActivities(req.responseXML)";
         doCallback(null);
    else
    hideDiv('activitySelect');
    showDiv('dateTo');
    function setActivities(theXmlResponse)
              //start filling the Venues Select boxes now
              if(theXmlResponse != null)
                   var coursesBox=document.getElementById("activitySelect");
                   coursesBox.options.length=0;
                   var activityElementsLength=theXmlResponse.getElementsByTagName('activity').length;     
                   var activityElementsArray=theXmlResponse.getElementsByTagName('activity');
                   //alert("length"+activityElementsLength+activityElementsArray);                              
              for(x = 0; x < activityElementsLength; x++)
                        //coursesBox.options[coursesBox.options.length] = new Option(coursesElementsArray[x].firstChild.text, coursesElementsArray[x].lastChild.text);
                        var optn = document.createElement("OPTION");
                   optn.text = activityElementsArray[x].firstChild.text;
    optn.value = activityElementsArray[x].lastChild.text;
    coursesBox.options.add(optn);
         if (activityElementsLength>0)
                   showDiv('activityTD');
              flag="release";
    </script>
    <div id="content"><!-- Top story -->
    <div id="topstory" class="box">
    <div id="topstory-img"></div>
    <!-- /topstory-img -->
    <div id="topstory-desc">
    <div id="topstory-title"><strong>BOOK Activity</strong></div>
    <!-- /topstory-title -->
    <div id="topstory-desc-in"></div>
    <!-- /topstory-desc-in --></div>
    <!-- /topstory-desc --></div>
    <!-- /topstory -->
    <div id="bodycontent">
    <% int errorCount=0; %>          
              <spring:bind path="bookactivityevent.*">
              <c:forEach items="${status.errorMessages}" var="error">
                        <B><font color="red">Error: <c:out value="${error}"/></font><B/>
                        <% errorCount++; %>
              </c:forEach>
              </spring:bind>
    <form method="post" name="bookActivityController" action="<c:url value="/secure/bookActivityTrainer.htm"/>">
    <table align="right" width="50%" border=0>
    <input type="hidden" name="activityTimeSelect"/>
    <input type="hidden" name="activityTimeSubType"/>
    <tr>
    <td align="left">
    <INPUT TYPE="checkbox" NAME="halfday" onclick="showHideAmPm('partofhalfday')">Half Day    
    <div align="left "id="partofhalfday" class="hidden">
    <INPUT TYPE="RADIO" NAME="am" onClick="getActivitiesAm()" value="am">AM <INPUT TYPE="RADIO" NAME="pm" onClick="getActivitiesPm()">PM <BR>
    </div>
    </td>
    </tr>
    <tr><td><INPUT TYPE="checkbox" NAME="singleday" onClick="getSingleDayActivities()"> Single Day</td>
    </tr>
    <tr>
    <td><INPUT TYPE="checkbox" NAME="moredays" onClick="getMoreDaysActivities()"> More Days</td>
    </tr>
         <tr>
              <td align="left" id="activityTD">Activity :
              <c:set var="activityMap" value=${requestScope.activityMap}/>
         <c:choose>
                        <c:when test="${activityMap = null}"
         <spring:bind path="bookactivityevent.userSuppliedActivity.activity.activityId">
              <select name="activitySelect" id="activitySelect" size="1"
                   STYLE="width: 150px">
                   <option value="Choose Activity" default>Choose Activity</option>
              </select>
              </spring:bind>
              </c:when>
              <c:otherwise>      
              <spring:bind path="bookactivityevent.userSuppliedActivity.activity.activityId">
              <select name="activitySelect" id="activitySelect"
                   size="1" STYLE="width: 150px">
                   <option value="" default>Choose Activity</option>
                   <c:forEach var="activity" items="${activityMap}" varStatus="a">
                        <c:choose>
                             <c:when
                                  test="${(bookactivityevent !=null) && (bookactivityevent.userSuppliedActivity.activity.activityId == activity.activityId)}">
                                  <option value="<c:out value="${activity.activityId}"/>" selected><c:out
                                       value="${activity.activityId}" /></option>
                             </c:when>
                             <c:otherwise>
                             <option value="<c:out value="${activity.activityId}"/>"><c:out
                                       value="${activity.activity}"/>
                             </c:otherwise>
                        </c:choose>
                   </c:forEach>
              </select>
         </spring:bind>
         </c:otherwise>
         </c:choose>
         </td>
    </tr>
         <tr>
              <td align="left">Trainer:
              <spring:bind path="bookactivityevent.userSuppliedActivity.trainer.trainerId">
              <select name="trainerId" id="trainerId"
                   size="1" STYLE="width: 150px">
                   <option value="" default>Choose Trainer</option>
                   <c:forEach var="trainer" items="${trainers}" varStatus="a">
                        <c:choose>
                             <c:when
                                  test="${(bookactivityevent !=null) && (bookactivityevent.userSuppliedActivity.trainer.trainerId == trainer.trainerId)}">
                                  <option value="<c:out value="${trainer.trainerId}"/>" selected>
                                  <c:out value="${trainer.firstName}"/>&nbsp<c:out
                                       value="${trainer.surName}" /></option>
                             </c:when>
                             <c:otherwise>
                                  <option value="<c:out value="${trainer.trainerId}"/>"><c:out
                                       value="${trainer.firstName}"/>&nbsp<c:out
                                       value="${trainer.surName}" /></option>
                             </c:otherwise>
                        </c:choose>
                   </c:forEach>
              </select>
         </spring:bind>     
              </td>
         </tr>
         <tr>
              <td align="left" id="dateFrom">From Date
              <spring:bind path="bookactivityevent.userSuppliedActivity.dateFrom">
              <input type="text" name="dateFrom" value=""/>
              </spring:bind>
              <img
                   src="../design/cal.gif" width="16" height="16" border="0"
                   alt="Click Here to Pick up the date"></td>
         </tr>
         <tr>
              <td align="left" id="dateTo" class="hidden">To Date
              <spring:bind path="bookactivityevent.userSuppliedActivity.dateTo">
              <input type="text" name="dateTo" value=""/>
              </spring:bind>
              <img
                   src="../design/cal.gif" width="16" height="16" border="0"
                   alt="Click Here to Pick up the date"></td>
         </tr>
         <tr>
              <td align="left" colspan="2"><input type="submit" name="_target1" value="BookActivity"/></td>
                   <c:if test="${(bookactivityevent != null) && (not empty bookactivityevent.conflictBookings)}">
    <td align="left" colspan="2"><input type="submit" name="_target2" value="OverRideBookings"/></td>
    </c:if>
              <td align="left" colspan="2"><input type="button" name="Cancel"
                   value="Cancel" onClick="goHomePage();" /></td>
         </tr>
    </table>
    </form>
    </div>
    <hr class="noscreen"/>
    <div class="content-padding"></div>
    <script language="JavaScript">
         var cal1 = new calendar1(document.bookActivityController.elements['dateFrom']);
         cal1.year_scroll = true;
         cal1.time_comp = false;
    var cal2 = new calendar1(document.bookActivityController.elements['dateTo']);
         cal2.year_scroll = true;
         cal2.time_comp = false;
    </script></div>
    <!-- /content -->
    package com.uk.nhs.training.controller;
    import java.beans.PropertyEditorSupport;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.swing.text.html.HTMLDocument;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.springframework.util.StringUtils;
    import org.springframework.validation.BindException;
    import org.springframework.validation.Errors;
    import org.springframework.validation.ValidationUtils;
    import org.springframework.web.bind.ServletRequestDataBinder;
    import org.springframework.web.servlet.ModelAndView;
    import org.springframework.web.servlet.mvc.AbstractWizardFormController;
    import org.springframework.web.servlet.view.RedirectView;
    import com.uk.nhs.training.contractUtility.ContractHtmlReader;
    import com.uk.nhs.training.data.Activity;
    import com.uk.nhs.training.data.ActivityMatrix;
    import com.uk.nhs.training.data.BookActivityEvent;
    import com.uk.nhs.training.data.Booking;
    import com.uk.nhs.training.data.BookingDetails;
    import com.uk.nhs.training.data.Client;
    import com.uk.nhs.training.data.Course;
    import com.uk.nhs.training.data.Trainer;
    import com.uk.nhs.training.data.Venue;
    import com.uk.nhs.training.data.ActivityTimeConstants;
    import com.uk.nhs.training.service.ActivityMatrixService;
    import com.uk.nhs.training.service.ActivityService;
    import com.uk.nhs.training.service.BookingDetailsService;
    import com.uk.nhs.training.service.BookingService;
    import com.uk.nhs.training.service.ClientService;
    import com.uk.nhs.training.service.CourseService;
    import com.uk.nhs.training.service.TrainersService;
    import com.uk.nhs.training.service.VenueService;
    public class BookActivityController extends AbstractWizardFormController {
         protected final Log logger = LogFactory.getLog(getClass());
         private BookingService bookingFacade;
         private BookingDetailsService bookingDetailsFacade;
         private CourseService courseFacade;
         private VenueService venueFacade;
         private ClientService clientFacade;
         private ActivityMatrixService activityMatrixFacade;
         private ActivityService activityFacade;
         private TrainersService trainersFacade;
         private SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
         public BookActivityController() {
              setCommandClass(BookActivityEvent.class);
         setCommandName("bookactivityevent");
         setBindOnNewForm(true);
         protected Object formBackingObject(HttpServletRequest request)
                   throws Exception {
              BookActivityEvent bookActivityEvent = new BookActivityEvent();
              ActivityMatrix activityMatrix = new ActivityMatrix();
              activityMatrix.setActivity(new Activity());
              activityMatrix.setTrainer(new Trainer());
              List<Booking> bookingList = new ArrayList<Booking>();
              bookActivityEvent.setUserSuppliedActivity(activityMatrix);
              bookActivityEvent.setConflictBookings(bookingList);
              return bookActivityEvent;
         public Map referenceData(HttpServletRequest request, Object command, Errors errors, int Page)
              List trainers = trainersFacade.loadTrainers();
         Map trainersActivitiesMap = new HashMap();
              trainersActivitiesMap.put("trainers", trainers);          
              return trainersActivitiesMap;
         protected ModelAndView processFinish(HttpServletRequest request,
                   HttpServletResponse response, Object command, BindException errors) {
              try {
                   ActivityMatrix activity = (ActivityMatrix) command;
                   activityMatrixFacade.saveActivityMatrix(activity);
                   logger.info("Activity is successfully saved for the trainer");
              } catch (Exception e) {
                   e.getClass();
                   e.printStackTrace();
              return new ModelAndView("bookSuccess");
         @Override
         protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
              dateFormat.setLenient(true);
              binder.registerCustomEditor(java.sql.Date.class, "dateFrom", new SqlDateEditor(true));
              binder.registerCustomEditor(java.sql.Date.class, "dateTo", new SqlDateEditor(false));
              binder.registerCustomEditor(java.sql.Date.class, null, new SqlDateEditor(true));
         protected ModelAndView handleInvalidSubmit(HttpServletRequest request,
                   HttpServletResponse response) throws Exception {
              return new ModelAndView("bookInvalidSubmit");
         @Override
         protected ModelAndView processCancel(HttpServletRequest request,
                   HttpServletResponse response, Object command, BindException errors)
                   throws Exception {
              return new ModelAndView(new RedirectView("welcome.htm"));
         @Override
         protected void onBindAndValidate(HttpServletRequest request,
                   Object command, BindException errors, int page) throws Exception {
              BookActivityEvent bookActivityEvent = (BookActivityEvent) command;
              System.out.println(" PAGE : " + page);
              try {
                   switch (page) {
                   case 0:
                        if (request.getParameter("_target1") != null) {
                             ActivityMatrix userActivityMatrix = bookActivityEvent.getUserSuppliedActivity();
                             buildActivityMatrix(request, bookActivityEvent);     
                             validateActivityMatrix(bookActivityEvent, errors);
                             if (errors.getErrorCount() == 0)
                                  Trainer trainer = (Trainer) trainersFacade.loadTrainersById(userActivityMatrix.getTrainer().getTrainerId());
                                  bookActivityEvent.getUserSuppliedActivity().setTrainer(trainer);
                                  Activity activity= (Activity) activityFacade.loadActivitiesById(userActivityMatrix.getActivity().getActivityId());
                                  bookActivityEvent.getUserSuppliedActivity().setActivity(activity);
                                  boolean activityExists = checkForExistingActivities(userActivityMatrix, errors);
                                  if(!activityExists)
                                  boolean bookingsExist =      checkForBookedCourses(request, bookActivityEvent, errors);
                                  if(bookingsExist)
                                       // inject an error code so that it can be used in GUI
                                       errors.rejectValue("dateFrom","invalid dates","Trainer has Bookings in conflict with the Supplied Activity Dates");
                                  else
                                       errors.rejectValue("dateFrom","Activity Dates supplied already exist");
                        break;
                   case 1:
                        if (request.getParameter("_target2") != null)
                             * Get the user supplied activitymatrix and try to get all the bookings which are in conflict for the trainer
                        List<Booking> conflictBookingsList = (List<Booking>)request.getSession().getAttribute("conflictBookingsList");
                        break;
                   default:
              } catch (Exception e) {
                   System.err.println("Exception :" + e.getMessage());
              super.onBindAndValidate(request, command, errors, page);
         * @param request
         * @param userActivity
         * @param bookActivityEvent TODO
         private ActivityMatrix buildActivityMatrix(HttpServletRequest request, BookActivityEvent bookActivityEvent) {
              ActivityMatrix userActivity = bookActivityEvent.getUserSuppliedActivity();
              userActivity.getTrainer().setTrainerId((String)(request.getParameter("trainerId")));
              userActivity.getActivity().setActivityId((String)(request.getParameter("activitySelect")));          
              String activityTime = (String)request.getParameter("activityTimeSelect");
              String activitySubType = (String)request.getParameter("activityTimeSubType");
              if("fullday".equals(activityTime))
                   userActivity.getActivity().setTime(ActivityTimeConstants.FULLDAY.toString());
              else if("moredays".equals(activityTime))
                   userActivity.getActivity().setTime(ActivityTimeConstants.MOREDAYS.toString());
              else if("halfday".equals(activityTime)&& "am".equals(activitySubType))
                   userActivity.getActivity().setTime(ActivityTimeConstants.AM.toString());               
              else if("halfday".equals(activityTime)&& "pm".equals(activitySubType))
                   userActivity.getActivity().setTime(ActivityTimeConstants.PM.toString());
              if(!("moredays".equals(activityTime)))
                   userActivity.setDateTo(bookActivityEvent.getDateFrom());
              userActivity.setDateFrom(bookActivityEvent.getDateFrom());
              bookActivityEvent.setUserSuppliedActivity(userActivity);
              return userActivity;
         * Create an empty Booking details for client and course...
         * @param booking
         private void setInitialBookingDetails(Booking booking, BindException errors) {
              if (booking.getBookingType().equals("Client-Based")) {
                   if (booking.getClient() == null
                             || booking.getClient().getClientId() == null) {
                        booking.setClient(new Client());
              } else if (booking.getBookingType().equals("Staff")) {
                   booking.setClient(null);
              if (booking.getBookingDetails() == null) {
                   List<BookingDetails> bkDetailsList = new ArrayList<BookingDetails>();
                   BookingDetails bkDetails = new BookingDetails();
                   bkDetails.setCourse(new Course());
                   bkDetailsList.add(bkDetails);
                   booking.setBookingDetails(bkDetailsList);
              } else {
                   List bkDetList = booking.getBookingDetails();
                   if (bkDetList.size() < 1
                             || (bkDetList.size() > 0 && !((bkDetList.get(0)) instanceof BookingDetails))) {
                        BookingDetails bkDetails = new BookingDetails();
                        bkDetails.setCourse(new Course());
                        bkDetList.add(0, bkDetails);
                        booking.setBookingDetails(bkDetList);
                   } else if (((BookingDetails) bkDetList.get(0)).getCourse() == null
                             || ((BookingDetails) bkDetList.get(0)).getCourse()
                                       .getCourseId() == null) {
                        ((BookingDetails) bkDetList.get(0)).setCourse(new Course());
         @Override
         protected void validatePage(Object command, Errors errors, int page,
                   boolean finish) {
              BookActivityEvent activityEvent = (BookActivityEvent) command;
              if (finish) {
              super.validatePage(command, errors, page);
         * Validate client
         * @param booking
         * @param err
         private boolean checkForExistingActivities(ActivityMatrix userSuppliedActivity, Errors err)
              boolean exist = false;          
              List<ActivityMatrix> trainerActivityMatrixList =      activityMatrixFacade.getActivityMatrixBetweenDateRange(userSuppliedActivity.getTrainer().getTrainerId(),
                        userSuppliedActivity.getDateFrom(), userSuppliedActivity.getDateTo());
              if(ActivityTimeConstants.MOREDAYS.equals(userSuppliedActivity.getActivity().getTime()))
                   //checkForDates(trainerActivityMatrixList,);
              else if(ActivityTimeConstants.FULLDAY.equals(userSuppliedActivity.getActivity().getTime()))
                   // checkForDates(trainerActivityMatrixList,);
              else if(ActivityTimeConstants.AM.equals(userSuppliedActivity.getActivity().getTime()) ||
                        ActivityTimeConstants.PM.equals(userSuppliedActivity.getActivity().getTime()))
                   // checkForDates(trainerActivityMatrixList,);
         return exist;          
              * Check for existing bookings for a trainer and sets them on event object
              * @param request request.
              * @param event event.
              * @param err err.
              * @return true- bookings exist else false.
    private boolean checkForBookedCourses(HttpServletRequest request, BookActivityEvent event, Errors err)
         List<Booking> conflictBookingsList =      bookingFacade.loadBookingsByTrainerIdDateRange(event.getUserSuppliedActivity().getTrainer().getTrainerId(),
                   event.getUserSuppliedActivity().getDateFrom(),
                   event.getUserSuppliedActivity().getDateTo());
    request.getSession().setAttribute("conflictBookingsList",conflictBookingsList);     
                   if(conflictBookingsList!=null && conflictBookingsList.size()!=0)
                   event.setConflictBookings(conflictBookingsList);
                   return true;
                   else
                        return false;
         * Validate client
         * @param booking
         * @param err
         private void validateActivityMatrix(final BookActivityEvent activity, Errors err) {
    //          ValidationUtils.rejectIfEmptyOrWhitespace(err, "trainer.trainerId",
    //                    "required.trainer.trainerId", "Valid trainer needs to be selected.");
    ////          ValidationUtils.rejectIfEmptyOrWhitespace(err, "activity.activityId",
    ////                    "required.activity.activityId", "Valid activity needs to be selected.");
    //          if (err.getErrorCount() < 1)
    //                    if (activity.getDateFrom() == null) {
    //                         err.rejectValue("dateFrom", "required.dateFrom",
    //                                   "Valid Activity Start Date is required");
    //                    try
    //                         if (activity.getDateFrom() != null && activity.getDateTo() != null
    //                                   && (activity.getDateTo().before(activity.getDateFrom())))
    //                              err.rejectValue("dateTo", "required.dateTo",
    //                                        "Activity End Date Should be after start date.");
    //                    } catch (Exception ex) {
    //                         err.rejectValue("dateFrom",
    //                                   "dateFrom",
    //                                   "Improper dates, please provide valid dates.");
         * Validate Trainer
         * @param booking
         * @param e
         private void validateTrainer(final Booking booking, Errors e) {
              ValidationUtils.rejectIfEmptyOrWhitespace(e,
                        "bookingDetails[0].startDate",
                        "required.bookingDetails[0].startDate",
                        "Valid Booking Details startDate required.");
              ValidationUtils.rejectIfEmptyOrWhitespace(e,
                        "bookingDetails[0].trainer.trainerId",
                        "required.bookingDetails[0].trainer.trainerId",
                        "Valid Booking Details Trainer required.");
              if (e.getErrorCount() < 1)
                   for (BookingDetails bd : booking.getBookingDetails()) {
                        if (bd.getStartDate() == null) {
                             e.rejectValue("startDate", "required.bbb0",
                                       "Valid Booking details Start Date is required");
                        try {
                             if (bd.getStartDate() != null && bd.getEndDate() != null
                                       && (bd.getEndDate().before(bd.getStartDate())))
                                  e.rejectValue("endDate", "required.bbb0",
                                            "End Date Should be after starting date.");
                        } catch (Exception ex) {
                             e.rejectValue("bookingDetails[0].startDate",
                                       "before.bookingDetails[0].startDate",
                                       "Improper dates, please provide valid dates.");
                        if (bd.getTrainer() != null) {
                             e.rejectValue("trianerId", "required.trianerId",
                                       "Valid Trainer details required.");
         public BookingService getBookingFacade() {
              return bookingFacade;
         public void setBookingFacade(BookingService bookingFacade) {
              this.bookingFacade = bookingFacade;
         public CourseService getCourseFacade() {
              return courseFacade;
         public void setCourseFacade(CourseService courseFacade) {
              this.courseFacade = courseFacade;
         public VenueService getVenueFacade() {
              return venueFacade;
         public void setVenueFacade(VenueService venueFacade) {
              this.venueFacade = venueFacade;
         public ClientService getClientFacade() {
              return clientFacade;
         public void setClientFacade(ClientService clientFacade) {
              this.clientFacade = clientFacade;
         public TrainersService getTrainersFacade() {
              return trainersFacade;
         public void setTrainersFacade(TrainersService trainersFacade) {
              this.trainersFacade = trainersFacade;
         * getter method for activityFacade.
         * @return Returns the activityFacade.
         public ActivityService getActivityFacade() {
              return activityFacade;
         * setter method for activityFacade.
         * @param activityFacade The activityFacade to set.
         public void setActivityFacade(ActivityService activityFacade) {
              this.activityFacade = activityFacade;
         * getter method for activityMatrixFacade.
         * @return Returns the activityMatrixFacade.
         public ActivityMatrixService getActivityMatrixFacade() {
              return activityMatrixFacade;
         * setter method for activityMatrixFacade.
         * @param activityMatrixFacade The activityMatrixFacade to set.
         public void setActivityMatrixFacade(ActivityMatrixService activityMatrixFacade) {
              this.activityMatrixFacade = activityMatrixFacade;
         * getter method for bookingDetailsFacade.
         * @return Returns the bookingDetailsFacade.
         public BookingDetailsService getBookingDetailsFacade() {
              return bookingDetailsFacade;
         * setter method for bookingDetailsFacade.
         * @param bookingDetailsFacade The bookingDetailsFacade to set.
         public void setBookingDetailsFacade(BookingDetailsService bookingDetailsFacade) {
              this.bookingDetailsFacade = bookingDetailsFacade;
         class SqlDateEditor extends PropertyEditorSupport {
              private boolean isRequired = false;
              SqlDateEditor(boolean isRequired) {
                   this.isRequired = isRequired;
              public void setAsText(String text) throws IllegalArgumentException {
                   java.util.Date d = null;
                   if (!this.isRequired && !StringUtils.hasText(text)) {
                        setValue(null);
                   else
                        try {
                             d = dateFormat.parse(text);
                             setValue(new java.sql.Date(d.getTime()));
                        } catch (ParseException ex) {
                             throw new IllegalArgumentException("Could not parse date: " + ex.getMessage());
              public String getAsText() {
                   Date value = (java.sql.Date)getValue();
                   if (value != null) {
                        java.util.Date d = new java.util.Date(value.getTime());
                        return dateFormat.fo

    This topic is hopeless. Too much unnecessary code. Unformatted code. No question. No requirements. No step-by-step explanation how to reproduce problem. No expectations. No unexpectations/errors.
    Please read this how to get better help.

  • Invalid identifier results from an sql statement in php

    hello there, i'm trying to access data from an oracle 11g database via oci and php 5.3.8.
    i'm getting the ORA-00904 (invalid identifier) error when executing the following statement:
    $stid = oci_parse($conn, 'select * from table1 where column1 = "XYZ"');
    when i do this:
    $searchstring = "XYZ";
    $stid = oci_parse($conn, 'select * from table1 where column1 = '.$searchstring.'');
    i'm getting this error:
    ORA-00933: SQL command not properly ended
    column1 is varchar2, the entries are either letters and numbers (never only numbers) or empty.
    when i do this:
    $stid = oci_parse($conn, 'select * from table1');
    i'm getting the data and there are entries in column1 with XYZ.
    has anyone an idea, what i do wrong?
    regards j

    The PHP forum for questions like this is at http://www.oracle.com/technetwork/forums/php/index.html
    You really need to be using a bind variable here. Otherwise you will likely suffer from poor DB performance, and also open yourself to SQL Injection security attacks. Try:
    $stid = oci_parse($conn, 'select * from table1 where column1 = :bv');
    oci_bind_by_name($stid, ":bv", $searchstring);Regarding quoting of your example try:
    $searchstring = "XYZ";
    echo  'select * from table1 where column1 = '.$searchstring.'';Then run that SQL in SQL*Plus and watch it fail. What you need is given with:
    echo  'select * from table1 where column1 = \''.$searchstring.'\'';See the bottom of p 126 of The Underground PHP and Oracle Manual
    Note that with the bind variable example you didn't need quotes around :bv.

Maybe you are looking for