How to get the WHOLE xml document inside a string using XSLT mapping

Hi folks,
I have a deep xml structure that I want to embed as body, tags included, in a mail message (not as an attachment).
I'm trying to use Michal's method in this blog
/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
However, I can't get it to deliver the entire structure instead of just specific elements.
Any help is greatly appreciated,
Thanks,
Guy

Ashok,
I was able to work it out for my case.
This XSL......
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<inside>
<namestring>
<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text>
<xsl:copy-of select="outside/name/*"/>
<xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text>
<xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
</namestring>
</inside>
</xsl:template>
</xsl:stylesheet>
...will transform this input....
<?xml version="1.0" encoding="UTF-8"?>
<outside>
<name>
<nameone>name1</nameone>
<nametwo>name2</nametwo>
<namethree>name3</namethree>
</name>
</outside>
...and put the whole lot into the CDATA element.
Hope this helps you,
Guy

Similar Messages

  • How to get the list of documents

    Hi everyone
    Can anyone help me How to get the list of documents residing in a folder of KM repository of SAP Netweaver using a simple java program
    Thanks in ADV.
    Rupesh Khemka

    Hi Rupesh,
    I have written the code for you and it works with WebDynpro, no seperate java program is required.
    Just try to paste it in your application code and run it.
    try{
         // Will check the user athentication for EP
                    IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
         IUser sapUser = wdClientUser.getSAPUser(); 
         com.sapportals.portal.security.usermanagement.IUser ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);
         ResourceContext context = new ResourceContext(ep5User);
                    // The path in which your folder resides
         RID rid1 =RID.getRID("/documents/Public Documents/SCAP/");
         IResourceFactory factory1 = ResourceFactory.getInstance();
         ICollection icollection = (ICollection)factory1.getResource(rid1, context);
         IResourceList resourcelist = icollection.getChildren();
         int size1 = resourcelist.size();
         for(int s=0; s<listOfDocuments.getLength(); s++){
              IResource resource = resourcelist.get(i);
              InputStream input = new InputStream();
              input = resource.getContent().getInputStream();
    }catch(Exception e){
         e.getMessage();
    Once you get the InputStream everything else is possible....
    This will surely help you in reading the documents from KM.
    Regards,
    Rekha Malavathu

  • How to get the resulting XML as string

    Hello,
    I think my question is very simple but i'm new in this area.
    What i'm try to do is to parse a XML document with the DOM parser. Then i manipulate the DOM tree. After finishing the process i want to get the resulting XML document as an InputStream to give to another application for storing back into the database.
    Until know i print the resulting XML to System.out or I write it to a file.
    Do you know where i can find more information about this? Sample code??
    Thanks!

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jinyu Wang ([email protected]):
    You can try following code. It is not the simplest way, but it works for me:
    // Print to temp buffer
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream output = new DataOutputStream(baos);
    Xml_doc.print(output);
    String outtemp=baos.toString();
    System.out.println(outtemp);
    include following line for the lib:
    import java.io.*;<HR></BLOCKQUOTE>
    Many thanks for the reply. It works!

  • How to extract the actual XML document from soap message?

    My problem is " how to extract the actual XML document from soap message? "
    i just want to extract the attachment i.e. (pure XML document without any soap header or envolope).
    i could be ver thank full if u could solve my problem.
    [email protected]

    Hi,
    This is some skeleton code for extracting an attachment from a SOAPMessage.
    import javax.activation.DataHandler.;
    import javax.xml.soap.*;
    import javax.xml.message.*;
    Iterator allAttachments = message.getAttachments();
    AttachmentPart ap1 = null;
    while(allAttachments.hasNext()){
    ap1 = (AttachmentPart)allAttachments.next();
    //Check that the attachment is correct one. By looking at its mime headers
    //Convert the attachment part into its DOM representation:
    if(ap1.getContentType() == "text/xml"){
    //Use the activation dataHandler class to extract the content, then create a StreamSource from
    //the content.
    DataHandler attachmentContent = ap1.getDataHandler();
    StreamSource attachmentStream = new StreamSource(attachmentContent.getInputStream());
    DOMResult domAttachment = getDOMResult(attachmentStream);
    domAttachment holds an xml representation of the attachment.
    Hope this helps.

  • How to get the store procedure name inside this store procedure?

    how to get the store procedure name inside this store procedure?

    Why cant you get the procedure name as hard code as the proc name is going to change.
    Are you looking for getting the parent proc name from child proc name which is getting executed within parent proc?
    Try the below:
    --Parent Proc
    Alter Proc sp_test
    as
    Begin
    Declare @s varbinary(MAX) = Cast('sp_test' as Varbinary(MAX));
    SET CONTEXT_INFO @s;
    exec sp_test2
    End
    --Child proc
    Alter proc sp_test2
    as
    SELECT Cast(CONTEXT_INFO() as varchar(100));
    --Test execution
    Exec sp_test
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped.
     [Blog]

  • How to get the Next Material Document Number

    Hi,
    Please let me know How to get the next Material Document Number using Functional Module,
    Material Document number are  in MSEG table.
    Regards,
    Ganesh

    Hi Ganesh,
    if you want the next matrial number then first of all you have to define it as a number range in transaction snro.After creating the number range you have to define the interval.
    now you can use your number range by calling the function module
    CALL FUNCTION 'NUMBER_GET_NEXT'
          EXPORTING
            nr_range_nr             = '01' " here you have to give the number range number which you have defined in number range
            object                  = 'ZPRODLOG' " Number Range
          IMPORTING
            number                  = wa_prod_error_log-seqnr " sequence number generated,in your case material number field
          EXCEPTIONS
            interval_not_found      = 1
            number_range_not_intern = 2
            object_not_found        = 3
            quantity_is_0           = 4
            quantity_is_not_1       = 5
            interval_overflow       = 6
            buffer_overflow         = 7
            OTHERS                  = 8.
    each and every time next number will get generated .
    i hope this will help you.
    Thanks,
    Tanmaya

  • How to get the whole payload

    Hey guys,
    I have a requirement where I need to call a stored procedure through a JDBC adapter. The particularity in this call is that I need to send the complete source XML payload as a string in just one element and not mapping each element with input variables of the store procedure.
    I need to know if there is a way to get the incoming XML payload as one big String within XI.
    Any inputs will be helpful !!!
    Cheers,
    Mauricio

    Hi,
    When you write a JAVA Mapping , you need to implement the StreamTransfromationClass which implements execute and setParameter methods.
    In the execute method , you get the Source XML as an InputStream and the need to push the Output XML as the output stream.
    You can use a DOM or SAX parser to prase the XML source and create the target XML.
    To get the entire Source into s String, use this code,
    BufferedReader in = new BufferedReader(new InputStreamReader(inp));
    StringBuffer buffer = new StringBuffer();
    String line="";
    while ((line = in.readLine()) != null) {
    buffer.append(line);
    String sourcexml=buffer.toString();
    Take a look at thise blog for Java Mapping,
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    Regards,
    Bhavesh

  • How to deploy the web.xml file when trying to use the JSP SDK from SAP?

    I want to use the adduser.jsp which downloaded form SAP SDK samples to add user in BO, but I cannot run it sucessfully. I believe it's caused the web.xml file was not deployed appropriately.
    could you please teach how to deploy the web.xml file for the JSP samples ?
    Could you show me some sample of web.xml for the SDK jsp files? Thank you very much!

    Ensure that you have followed below directory structure while deploying your web application.
       web_application_name
          WEB-INF
             lib
             classes
    web.xml must be placed in WEB-INF. Ensure that you have included all the jar files and other necessary files in your application.
    For more information refer to the below link:
    http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm
    Regards,
    Anuj

  • Printint XML string using  XSLT mapping

    Hi,
    I'm trying to build a outgoing SOAP message with in XI, my backedn legacy application expect the soap message to be in certain format. It expect the xml request passed in the body of the message as whole xml string. I need to pring the xml something like this, I would appreciate if anyone had implemented something like this before. if you look at the below message I'm enclosing the whole xml string in the data element.
    <data xsi:type="xsd:string"><?xml version="1.0" encoding="UTF-8"?> <crm:schedule_call_request session_id="mid://07060623130210031519@elnk_crm.com" target_system_id="csi_ivr" xmlns:crm="https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_crm.xsd" xmlns:xcommon="https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_common.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_crm.xsd https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_crm.xsd https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_common.xsd https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_common.xsd"> <crm:call_parameter global_rules_version_id="" manual_request="true" originating_skillset="TS (DU/BB)|ADSL RETAIL" parameter_version_id="1" transfer_skillset="TSBBDSL...WinELNK"> <crm:call_id>10031519</crm:call_id> <crm:department_name>TS</crm:department_name> <crm:object_type>CASE</crm:object_type> <crm:object_id>73079085</crm:object_id> <crm:call_time>2007-06-07T12:30:01.000-08:00</crm:call_time> <crm:customer_phone_number>6263452656</crm:customer_phone_number> <crm:override_attempts>false</crm:override_attempts> <crm:retry_count>3</crm:retry_count> <crm:call_trigger>3000</crm:call_trigger> <crm:call_time_padding>10</crm:call_time_padding> <crm:override_local_customer_call_hours>false</crm:override_local_customer_call_hours> </crm:call_parameter> </crm:schedule_call_request></data>

    Hi
    thanks for responding. here is the input SOAP message that I was building in the XLT mapping. I was stuck at putting the xml in the data element.
    soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <soapenv:Header>
    - <wsa:EndpointReference soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
      <wsa:Address xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">https://xmlc-qe.corp.earthlink.net/ws_xmlc/s_router</wsa:Address>
      <wsa:ServiceName wsa:PortName="XMLCollectivePort" xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">wsa:ServiceName</wsa:ServiceName>
      </wsa:EndpointReference>
      <wsa:To soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="soapenc:string" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">https://xmlc-qe.corp.earthlink.net/ws_xmlc/queues/csi_queue</wsa:To>
      <wsa:Action soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="soapenc:string" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">https://xmlc-qe.corp.earthlink.net/ws_xmlc/action//messaging/put_single</wsa:Action>
      <wsa:MessageID soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="soapenc:string" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">07060623130210031519</wsa:MessageID>
    - <wsse:Security soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext">
    - <wsse:UsernameToken>
      <wsse:Username xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">elnk_crm</wsse:Username>
      <wsse:Password wsse:Type="wsse:PasswordDigest" xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">20UioFa77hI6MLhlc+KPDF95Hx0=</wsse:Password>
      <wsse:Nonce xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">VlX1Jpoq+vkQCQ8af2SaCDP1u9c=</wsse:Nonce>
      <wsu:Created xsi:type="soapenc:string" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">2007-06-06T23:13:12Z</wsu:Created>
      </wsse:UsernameToken>
      </wsse:Security>
      </soapenv:Header>
    - <soapenv:Body>
    - <ns1:SubmitRequest soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="SubmitRequest">
      <data xsi:type="xsd:string"><?xml version="1.0" encoding="UTF-8"?> <crm:schedule_call_request session_id="mid://07060623130210031519@elnk_crm.com" target_system_id="csi_ivr" xmlns:crm="https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_crm.xsd" xmlns:xcommon="https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_common.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_crm.xsd https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_crm.xsd https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_common.xsd https://signup.earthlink.net/ws_xmlc/schema/crm/271005/xmlc_common.xsd"> <crm:call_parameter global_rules_version_id="" manual_request="true" originating_skillset="TS (DU/BB)|ADSL RETAIL" parameter_version_id="1" transfer_skillset="TSBBDSL...WinELNK"> <crm:call_id>10031519</crm:call_id> <crm:department_name>TS</crm:department_name> <crm:object_type>CASE</crm:object_type> <crm:object_id>73079085</crm:object_id> <crm:call_time>2007-06-07T12:30:01.000-08:00</crm:call_time> <crm:customer_phone_number>6263452656</crm:customer_phone_number> <crm:override_attempts>false</crm:override_attempts> <crm:retry_count>3</crm:retry_count> <crm:call_trigger>3000</crm:call_trigger> <crm:call_time_padding>10</crm:call_time_padding> <crm:override_local_customer_call_hours>false</crm:override_local_customer_call_hours> </crm:call_parameter> </crm:schedule_call_request></data>
      </ns1:SubmitRequest>
      </soapenv:Body>
      </soapenv:Envelope>

  • How to get the filename of document that opened my app

    Hope that makes sense. I'm relatively new to OS X programming and have built a small Cocoa app (not a document-based app). I've associated a file type (.myFileType) with my application. If I double-click a file with that file type, it opens my app automatically as expected. From within my app, how do I get the full pathname of the document that opened my app?

    I know what you're saying. IB is made to seem easy, but when you start asking "What's this?", and "What does that do when the nib is loaded??", the pretty pictures suddenly aren't as clear as they seemed. Been there!
    The File's Owner never causes the creation of an object. It's always a "proxy" (a stand-in) for an object that's created elsewhere. The actual object may be defined in another xib, or it may be created in code. In MainMenu.xib. the File's Owner is a proxy for the Application object. The Application object isn't created because of that nib, it's created by the startup code before the nib is loaded. But the "proxy" allows you to make connections to the Application object in the xib.
    I know this is clear as mud so far, but it will start to make sense after you grok a few more pieces of the puzzle. A good place to start might be Anatomy of a Nib File in the +Resource Programming Guide+.
    Nib proxies are actually easier to understand when building an iPhone app. In that case, the SDK makes it much easier to associate proxies with the objects they represent. The concept is still the same, but for example, bridging two iPhone xibs with a proxy only takes a couple mouse clicks in IB.
    Hope that helps!
    \- Ray

  • How to get the web of document from the URL

    Hi All,
    Need small help here,
    I have SharePoint doc URL as below:
    http://sharepoint.com/sub1/sub2/sub3/documents/TestFile.docx
    Here, TestFile existed in document library of Subsite i.e. sub3.
    If I give above URL as input, I should be able to get "sub3" web.
    How can achieve this programmatically. Overall we should get the leaf web from the URL.
    Thanks in advance.
    Krishnasandeep

    Hi Sanny521,
    The SPSite constructor does not care when you pass in the document library and filename as part of the url. you can use the following code:
    string myFileUrl = "http://sharepoint.com/sub1/sub2/sub3/documents/TestFile.docx";
    using (SPSite site = new SPSite(myFileUrl))
    using (SPWeb web = site.OpenWeb())
    SPFile file = web.GetFile(myFileUrl);
    string webUrl = web.ServerRelativeUrl;
    You pass the full url into the SPSIte constructor, it will retrieve the site collection, then the OpenWeb call will retrieve the proper web from the already passed full url, then you can retrieve the file and the url of the SPWeb.
    Mathieu Desmarais http://www.matdesmarais.com/

  • How to get the request xml string in Business service.

    Hi
    I have following requirement
    1) XAI inbound service will get a input xml request feed and call the Business Service.
    2) Business service will do some validation and do the insert in the database.
    My BS schema is as below
    <schema pageAction="change">
    <personId mapField="PER_ID"/>
    <personOrBusiness mapField="PER_OR_BUS_FLG"/>
    <name mapField="ENTITY_NAME" mdField="C1_ENTITY_NAME"/>
    <emailAddress mapField="EMAILID"/>
    <city mapField="CITY"/>
    <county mapField="COUNTY"/>
    <postal mapField="POSTAL"/>
    <houseType mapField="HOUSE_TYPE"/>
    <taxVendorGeographicalCode mapField="GEO_CODE"/>
    <isInCityLimit mapField="IN_CITY_LIMIT"/>
    <state mapField="STATE"/>
    <version mapField="VERSION"/>
    <division mapField="CIS_DIVISION"/>
    <accessGroup mapField="ACCESS_GRP_CD"/>
    <address1 mapField="ADDRESS1"/>
    <personCharacteristic type="list" mapList="CI_PER_CHAR">
    <personId mapField="PER_ID"/>
    <characteristicType mapField="CHAR_TYPE_CD"/>
    <characteristicValue mapField="CHAR_VAL"/>
    <effectiveDate mapField="EFFDT"/>
    <adhocCharacteristicValue mapField="ADHOC_CHAR_VAL"/>
    <characteristicValueForeignKey1 mapField="CHAR_VAL_FK1"/>
    <characteristicValueFK2 mapField="CHAR_VAL_FK2"/>
    <characteristicValueFK3 mapField="CHAR_VAL_FK3"/>
    <characteristicValueFk4 mapField="CHAR_VAL_FK4"/>
    <characteristicValueFK5 mapField="CHAR_VAL_FK5"/>
    </personCharacteristic>
    </schema>
    The request XML to BS is as below_
    (support.schema.AbstractSchemaBasedDispatcher) Performing page:change of BusinessService CM_SPRDSHT_BS' (service='CMSPRDHSHTUPLD'), with input request
    <?xml version="1.0" encoding="UTF-8"?>
    <CM_Person>
    <personOrBusiness>P</personOrBusiness>
    <name>Marsh,Corporate</name>
    <emailAddress>[email protected]</emailAddress>
    <city>Tampa</city>
    <country>USA</country>
    <postal>2131</postal>
    <houseType/>
    <taxVendorGeographicalCode/>
    <isInCityLimit/>
    <state>CA</state>
    <version>1</version>
    <division>930</division>
    <accessGroup>***</accessGroup>
    <address1>Address of Khan</address1>
    </CM_Person>
    I can access the values of each xml node in BS with the help of data item.
    I wanted to know how can I get the above request xml string in my Business Service in Java.

    {color:#0000ff}http://java.sun.com/javase/6/docs/api/java/lang/Integer.html#parseInt(java.lang.String)
    http://java.sun.com/javase/6/docs/api/java/lang/Integer.html#valueOf(java.lang.String){color}

  • How to get the status of Javascript inside a java class

    Hi,
    Can anybody let me know the way by which I can get the status of Javascript (enabled/disabled) in browser inside a Java Class.
    I do have a trick -
    <input type="hidden" name="jstatus" value="disabled">
    <input type="submit" name="submit" onClick="doChecking()">
    <script language= javascript>
    function doChecking()
    document.form.jstatus.value = "enabled";
    submit();
    Now inside our java class we can check the value of "jstatus" if it is disabled then it is disabled else it is enabled.
    Ha ha wat a stupid trick...... ;-)
    Plz let me know a real approach to determine the Javascript status.
    Cheers !!!
    Irshad

    Actually, I don't think that trick is stupid at all. Javascript and Java are normally in no way related (javascript is just plain text content to your servlets / jsp's). So a good way of getting such information to your server is submitting it, like you do.
    Another possibility would be to do it with Ajax in the background, but that all depends on what you do with the information.

  • How to get a component's value inside a repeater using the component's id?

    Hello I'm using a repeater with an httpservice as dataprovider.
    in this repeater, I have a <mx:Panel> containing a <mx:Text>, a <mx:ButtonBar>, and a <mx:HSlider>.
    I need to get the text property of the Text component and the HSlider's value when the slider's value changed. (using the "change=..." property of my HSlider).
    How to do this as I have to know which Panel, HSlider, and which Text has been activated by the slider change?
    Thanks for your help

    This might help you.
    <?xml version="1.0"?>
    <!-- repeater\GetItem.mxml -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
             import mx.controls.Alert;
           [Bindable]
           public var myAC:Array=[1,2,3,4];
           public function getData(event:Event):void{
                     Alert.show(event.currentTarget.text);
                     Alert.show(mySlider[event.target.repeaterIndices].value);
        ]]>
      </mx:Script>
      <mx:Repeater id="myrep" dataProvider="{myAC}">
          <mx:TextInput change="getData(event);" />
          <mx:HSlider id="mySlider" maximum="200" minimum="50" value="67"  snapInterval="1"/>
      </mx:Repeater>
    </mx:Application>

  • How to get the whole map image after zoom in?

    Hi,
    I use mapviewer API to generate map images and put them in JSP as well as in Java Applet. I called the method getGeneratedImage(). After I using the methods zoomIn() or zoomOut(), I got a new map image. But the size is fixed, so after zoom in I can only see a part of the whole map. I would like to use scrollbar to see other part of the map after zoom in.
    How can I solve this problem? I have the images as predefinied themes saved in database with MBR information.
    Thanks in advance.

    Hi,
    For the map request in MapViewer you may define the data area that you want to display, as well as the device size (width and height). The result is a java Image with width and height sizes. You can draw this image on a canvas with scroll bars, and if the size of the canvas is smaller than the image size, then you should see the scroll bars. But you have to code that. MapViewer will just return an Image with the specified size.
    The zoom in/out options just change the data area, but keeps the device size. Therefore you should use the API methods to set the data area (setBox or setCenterAndSize) and to set the device size (setDeviceSize), in order to control the size of your resulted image, and then draw it on your canvas with scroll bars.
    Regards.

Maybe you are looking for