Prinitng iwork document using objective c

Please help in order to resolve the printing issue that i am facing while coding in objective c.
I want to print any file like (*.pages,*.numbers,*.keynote)
but i am not able to print these files using PMPrinterPrintWithFile function of objective c
I am able to print other files like *.txt,*.jpeg,*.png, *.pdf.
when I try to print iwork document like *.pages file with PMPrinterPRintWithFile, it returns a status as 1028
when I am printing other files like *.pdf,*.txt it is printed easily with status 0
and one more point I am not able to find out the MimeType of files like *.pages,*.number,*.keynote
the MIMETYPE object gets NULL value when i fetch it using the below code.
The Code I am using :
    #import "Cocoa/Cocoa.h"
    int main(int argc, char *argv[])
    NSPrintInfo *printInfo = [[NSPrintInfo alloc] init];
    PMPrintSession myPrintSession= (PMPrintSession)[printInfo PMPrintSession];
    PMPrintSettings printSetting= (PMPrintSettings)[printInfo PMPrintSettings];
    PMPageFormat pageFormat=(PMPageFormat)[printInfo PMPageFormat];
    OSStatus err = PMCreateSession(&myPrintSession);
    OSStatus status;
    CFURLRef fileURL =(CFURLRef) [NSURL fileURLWithPath:@"filename example *.*"];
    NSString* filePath=@"filename ex *.*";
    NSString* FullPath=[filePath stringByExpandingTildeInPath];
    NSURL * url= [NSURL fileURLWithPath:FullPath];
    NSURLRequest* fileUrlRequest = [[NSURLRequest alloc] initWithURL:url];
    NSError* error = nil;
    NSURLResponse* response = nil;
    NSData* fileData = [NSURLConnection sendSynchronousRequest:fileUrlRequest
    returningResponse:&response error:&error];
    NSString * MIMETYPE= [response MIMEType];
    [fileUrlRequest release];
    NSLog(@"MIMETYPE %@",MIMETYPE);
    PMPrinter thisPrinter= "printername";
    status = PMPrinterGetMimeTypes(thisPrinter, printSetting,&mimeTypes);
    if(status==noErr)
          status= PMPrinterPrintWithFile(thisPrinter, printSetting, pageFormat,     
        (CFStringRef)MIMETYPE, fileURL);
          NSLog(@" value :%@",MIMETYPE);
          NSLog(@"%i",status);
          NSLog(@"=======Printer %@=======", PMPrinterGetName( thisPrinter) );
          [printInfo release];
      return 0;
    return NSApplicationMain(argc,  (const char **) argv);

Thank you for your reply. This code helps me to open my local document
MicrosoftWordDocument *activeWordDoc= [wordApp activeDocument];
[activeWordDoc openFileName:@"file://localhost/Users/ramesh/Desktop/test.doc"
                     confirmConversions: FALSE
                               readOnly: FALSE
                       addToRecentFiles: FALSE
                       passwordDocument: @""
                       passwordTemplate: @""
                                 Revert: FALSE
                          writePassword: @""
                  writePasswordTemplate: @""
                          fileConverter:MicrosoftWordE162OpenFormatDocument97];
Can you please tell me how to observe when user saves that document

Similar Messages

  • Link IDoc to FI document using Object Services

    We are using a custom IDoc to post financial documents to the R/3 system. There is a requirement to determine the IDoc number that created the accounting document as happens automatically with Incoming Invoices (object type BUS2081).
    I'd like to form the link between the IDoc and the Financial document using Generic Object Services so that the Relationships functionality in transaction FB03 can be used. Does anyone know how I can form the link between the IDoc and the Accounting document when posting the document? We use BAPI_ACC_DOCUMENT_POST to post the Accounting document.
    Thanks in advance for any help.
    Regards,
    JB

    call function 'BDS_BUSINESSDOCUMENT_CREA_URL'
          exporting
            logical_system = logical_system
            classname      = classname_select
            classtype      = classtype_select
            client         = sy-mandt
            object_key     = objkey_select
          tables
            uris           = i_uris
          exceptions
            error_kpro     = 1
            internal_error = 2
            others         = 3.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
                  with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.
    for logical_system use FM OWN_LOGICAL_SYSTEM_GET to get your logical system name.
    class name= BKPF
    classtype = BO
    object_key = <companycode><doc number><year> e.g 011000001234562007
    in uris talbe pass the urls to be created.
    Raja

  • Attaching documents using object services

    Hello,
    Are there any performance/sizing guidelines for utilizing the object services function to attach documents to service orders, notification, equipment, etc?
    Our users would like to do this, and I am concerned about performance.
    chris

    Hi Chris,
    from the document point of view I do not know any restrictions which lead to a loss in performance if you attach more documents to a service order or something else.
    Best regards,
    Christoph

  • Storing documents using Object Services

    Hello,
    Does anybody know how to activate the Menu Entry 'Store Business Document' ?
    Thank you ,
    Aranka

    Hi Chris,
    from the document point of view I do not know any restrictions which lead to a loss in performance if you attach more documents to a service order or something else.
    Best regards,
    Christoph

  • Is there a way to use Automator or AppleScript to convert iWork documents to Office Documents?

    I use iWork for my documents, but I sometimes need to convert a folder of iWork files to Microsoft Office files. It's one thing to convert one iWork document, but it's very tedious when I need to convert multiple documents. I'm hoping to be able to automate this process. By the way, I'm using the latest versions of the iWork applications, which I know have a lot less or no Automator support.

    Interestingly, the only Pages specific command in the AppleScript dictionary for Pages 5.1 is Export, and Word is one of the available formats. I have no idea how well it works (and no interest in producing Word docs) but it might be possible to do this for Pages documents.
    Numbers 3.1 has just added AppleScript support, but it does not have an Export command.
    I don't have Keynote to check.

  • Attach Documents using Generic Object Services

    With reference to Manual Bassani's SDN Contribution of code examples on how to attach documents using Generic Object Services - we have found that since implementing ECC 6 the following code no longer works (at the end of page 9):
    CALL CREATE ATTACHMENT SERVICE FROM TOOLBAR
    WHEN 'ATTACH'.
    CALL METHOD MANAGER->START_SERVICE_DIRECT
    EXPORTING
    IP_SERVICE = 'CREATE_ATTA'
    IS_OBJECT = OBJ
    EXCEPTIONS
    NO_OBJECT = 1
    OBJECT_INVALID = 2
    EXECUTION_FAILED = 3
    OTHERS = 4.
    It is necessary to use IP_SERVICE = 'PCATTA_CREA' to get this to function correctly.
    The original document can be found at [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0e6b0d95-0a01-0010-4696-ca0a48de5fb3]

    Check the Naimesh Patel Blog he explain very well
    http://help-abap.blogspot.com/2009/02/generic-object-services-gos-toolbar.html

  • COM object model not functioning after encrypting the word document using office extention

         After encrypting A word document using office extention, it seems like the COM object model becomes unusable. I cannot not manipulate the encrypt document through COM interface, nor can I write macro VBScript to do some operation on the docuent.
         For example, I create a word Macro with some simple code.
    Sub hi()
        Dim i As Integer
        i = ThisDocument.Fields.Count
        MsgBox i   
    End Sub
         If the document is not encrypt, then we will see a msgbox which tells us the number of bookmarks in the current document.
         Now, encrypt the word document using the office extention, running the macro code will fail with error code " 80004005" and error message:Method 'Fields' of bject 'ThisDocument' failed.
    It is very important for us to manipulate word documents through COM interface in our system, I want to know why the COM interface does not work anymore after the document is encrypted.

    I take macro script as an example to demonstrate that word COM object model cannot be used after encripted. Actually you can reproduce the same problem when you manipulate word document through COM interface using any programming language.
    For example, you can create a text document  with the following VBscript:
    set a = createobject("Word.Application")
    set doc = a.Documents.Open("E:\temp\test.docx")
    msgbox doc.Fields.count
    doc.close
    a.quit
    Save the document with ".vbs" file extention and then run it by double clicking it. it will fail if the document is encrypted using the office extention. 

  • I have just purchased a MacBook Pro and iWork's. when I try to upload documents using iCloud, it now wants me to purchase iWorks for iOS ? Do I need to purchase both versions?

    I have just purchased a MacBook Pro and iWork's. When I try to upload documents using iCloud, it now wants me to purchase iWorks for iOS ? Do I need to purchase both versions?

    To be able to use documents at iCloud.com, you need at least one iOS device that uses the same account with at least one of the iWork apps installed.

  • Error while loading an XML document using a structured application

    Hi,
    I try to load an XML document using a structured application defined in the default structapps.fm
    My code is shown down, extracted from the FDK API code sample.
    Problem, I always have the same message :
    "Cannot find the file named e:\xml\AdobeFrameMaker10\file. Make sure that the file exists. "
    Where "e:\xml\AdobeFrameMaker10\" is my install directory.
    So I assume that frame try to find the structapps.fm file but does not find it.
    What else can it be ?
    Does anyone knowns how to achieve this simple task using extendScript ?
    Thanks for any comments, Pierre
    function openXMLFile(myLastFile) {
        var filename = myLastFile.openDlg("Choose XML file ...", "*.xml", false);
        if (filename != null) {
            /* Get default open properties. Return if it can’t be allocated. */
            var params = GetOpenDefaultParams();
            /* Set properties to open an XML document*/
            /*Specify XML as file type to open*/
            var i = GetPropIndex(params, Constants.FS_OpenAsType)
            params[i].propVal.ival = Constants.FV_TYPE_XML;
            /* Specify the XML application to be used when opening the document.*/
            i = GetPropIndex(params, Constants.FS_StructuredOpenApplication)
            params[i].propVal.sval = "myApp";
            i = GetPropIndex(params, Constants.FS_FileIsOldVersion)
            params[i].propVal.ival = Constants.FV_DoOK
            i = GetPropIndex(params, Constants.FS_FontNotFoundInDoc)
            params[i].propVal.ival = Constants.FV_DoOK
            i = GetPropIndex(params, Constants.FS_FileIsInUse)
            params[i].propVal.ival = Constants.FV_DoCancel
            i = GetPropIndex(params, Constants.FS_AlertUserAboutFailure)
            params[i].propVal.ival = Constants.FV_DoCancel
            /*The structapps.fm file containing the specified application must have
            already been read. The default structapps.fm file is read when FrameMaker is
            opened so this shouldn't be a problem if the application to be used is
            listed in the structapps.fm file.*/
            var retParm = new PropVals()
            var fileObj = Open(filename, params, retParm);
            return fileObj
        } else {
            return null;

    Pierre,
    Depending on the object "myLastFile", the method openDlg might not even exist (if the myLastFile object is not a File object, for instance). And I do not see any need for the myLastFile anyhow, as you are presenting a dialog to select a file to open. I recommend using the global ChooseFile( ) method instead. This will give you a filename as string in full path notation, or null when no file was selected in the dialog. I am not sure what your ExtendScript documentation states about the return value for ChooseFile, but if that differs from what I am telling you here, the documentation is wrong. So, if you replace the first lines of your code with the following it should work:
    function openXMLFile ( ) {
        var filename = ChooseFile ( "Choose XML file ...", "", "*.xml", Constants.FV_ChooseSelect );
    While writing this, I see that Russ has already given you the same advice. Use the symbolic constant value I indicated to use the ChooseFile dialog to select a single file (it can also be used to select a directory or open a file - but you want to control the opening process yourself). Note that this method allows you to set a start directory for the dialog (second parameter). The ESTK autocompletion also gives you a fifth parameter "helplink" which is undocumented and can safely be ignored.
    Good luck
    Jang

  • Can't Delete iWork Documents

    Whenever I try to empty the trash with an iWork document inside, it says they're in use, but I didn't open them at all.

    When they've been in the trash for a while, they can be emptied. I think it's answered.

  • Create Sales Order With Reference to Billing Document Using BAPI_SALESORDER

    Hi,
    How can i create a sales order With Reference to Billing Document Using BAPI_SALESORDER_CREATEFROMDAT2?
    Thanks in advance,
    Alejandro.

    I have to create sales order with reference to existing billing document. I have tried to following bapis.
    1. BAPI_SALESORDER_CREATEed
    I have successfully created document with following details.
    -->ORDER_HEADER_IN:
    DOC_TYPE =                  ZRK
    SALES_ORG =              3000
    DISTR_CHAN   =            00
    DIVISION =                    00
    ORD_REASON =            100
    SD_DOC_CAT   =          L
    CURRENCY       =         EUR
    REF_DOC          =         100000028
    REF_DOC_CA    =         M
    -->ORDER_ITEMS_IN:
    ITM_NUMBER    =           000010
    MATERIAL          =          701791
    TARGET_QTY     =          0000000001000
    CURRENCY        =          EUR
    REF_DOC           =          100000028
    REF_DOC_CA     =          M
    -->ORDER_PARTNERS:
    PARTN_ROLE      =          SP
    PARTN_NUMB      =         W12001
    COUNTRY             =         NL
    by providing this input i am able to create the document but it is not picking up the net value. so i have passed some extra paramters in  ORDER_ITEMS_IN
    COND_TYPE          =        PNET
    COND_VALUE        =        14,56
    COND_D_UNT        =         PC.
    folowing error is occured: Condition PNET is missing in pricing procedure A V Z0000.
    is it something related to configuration problem?
    2.BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2
    I have used same test data that is used for BAPI_SALESORDER_CREATEFROMDATA (where in i coudl succefully create doc). but here i encounterd following error.
    Unpermitted combination of business object BUS2032 and sales doc. category L.

  • [IDCS2]How to move the Snippet in a folder inside the Indesign Document Using Script?

    Hi
    How should i move all the snippet objects in a folder in to an Indesign Document using Javscript?
    Thanks
    myriaz

    Once you have the snippet in your document, how do you move it/select it? My snippet is a text frame with a table in it.
    This does NOT work:
    var myFoot = myDocument.pages.item(0).place("Hard Drive:Users:Casey:Desktop:footer.INDS")
    myFoot = myFoot[0]
    myFoot.geometricBounds = ["1", "1", "1", "1"]
    The snippet gets placed, but my error says "Object does not support the property or method 'geometricBounds'. This code works for normal images I place.
    JS - Mac - CS3
    Casey

  • Not possible to print a SWF in a PDF document using the Print command in Ad

    Have a PDF with 3 pages, page 1 and 3 contains text and the 2nd page contains a SWF animation made with Xcelsius 2008. When printing the document using the Print function in Adobe the 2nd page is always empty, the SWF is never printed.  To be able to print the 2nd page containing the SWF animation I must use the print function in the Flash player (right click on the SWF animation).
    This problem should, according to Business Objects, be solved with the new version of Adobe Reader 9, but the problem still appear.

    I have seen this.  Adobe 9 cannot print embedded flash objects.  Xcelsius Engage/2008 includes a print button you can include on your dashboards to allow you to print them from your pdf files.

  • Missing fonts in iWork documents

    My iWork apps keep giving me missing font document warnings when I launch Pages, Keynote and Numbers documents. This is a problem already reported by many other iWork users but I haven't found a satisfactory solution and I'm hoping someone here can help.
    When launching an existing Pages document, I get this document warning:
    Here's what I see in the Font Chooser. Helvetica has got some new variants like '.Light Oblique'. What the??
    But if I quit Pages and then create a new document, I don't get any warnings. The Font Chooser also behaves as usual:
    I've validated my fonts, deleted the font cache, repaired permissions in an attempt to fix the problem with no success. What should I do?

    I'd like to add perhaps a slightly different perspective to this problem. I'm a graphic designer and use Insider Software's FontAgent Pro to manage all of the fonts on my machine. I use Font Book only to manage the few system fonts that are necessary to run the OS.
    I keep the number of activated fonts to a minimum and regularly clean out the font caches to prevent any problems with all of the design apps that I use. I've done this for years and haven't experienced any font-related problems for a long, long time.
    When I want to use Helvetica/Neue Helvetica (which is rarely), I use PostScript Type 1 versions of those fonts. I don't want to reinstall the dfont version of Helvetica, because that will create conflicts with the fonts in my commercial work.
    Whenever I open or create an iWork document I get the Missing Font error mentioned in this thread. The new version of iWork lets me select a substitute font, but my choice never seems to "stick." Once I close the document and reopen it, the same message reappears. iWork seems to assume that every document must use the dfont version of Helvetica/Helvetica Neue, regardless of what I want.
    Why can't I specify what font I'd like to use, and have it become the default for all of the iWork apps? Until Apple fixes this problem the whole suite will have to remain shelfware and I'll keep using Office. I'd prefer to use iWork, but at least Office doesn't insist on nagging me about my font choices.
    SB

  • Uploading document using Powershell is throwing error- There is no file with URL

    Hi.
    I am trying to upload multiple documents to a sub folder in a library using powershell.
    I am getting the error as : ForEach-Object : Exception calling "Add" with "3" argument(s):
    "<nativehr>0x80070003</nativehr><nativestack></nativestack>There is no file
    with URL 'server/TestLibrary/User_image/ab_3f_wht_ist_small_gif.gif' in this Web."
    I have used the below code:
    function UploadImages($weburl)
    $docLibraryName = "TestLibrary"
    $localFolderPath = "C:\Users\Imgs\user_image"
    Add-PsSnapin Microsoft.SharePoint.PowerShell -erroraction silentlycontinue
    $web = Get-SPWeb -Identity $webUrl
    $docLibrary = $web.Lists[$docLibraryName]
    $subFolderName="user_image"
    Add-PsSnapin Microsoft.SharePoint.PowerShell -erroraction silentlycontinue
    $web = Get-SPWeb -Identity $webUrl
    $docLibrary = $web.Lists[$docLibraryName]
    #Attach to local folder and enumerate through all files
    $files = ([System.IO.DirectoryInfo] (Get-Item $localFolderPath)).GetFiles() | ForEach-Object {
    #Create file stream object from file
    $fileStream = ([System.IO.FileInfo] (Get-Item $_.FullName)).OpenRead()
    $contents = new-object byte[] $fileStream.Length
    $fileStream.Read($contents, 0, [int]$fileStream.Length);
    $fileStream.Close();
    write-host "Copying" $_.Name "to" $docLibrary.Title "in" $web.Title "..."
    #Add file
    $folder = $web.getfolder($docLibrary.Title + "/" + $subFolderName)
    write-host "folder is " $folder
    $spFile = $folder.Files.Add($folder.Url + "/" + $_.Name, $contents, $true)
    $spItem = $spFile.Item
    Write-Host -f Green "Added Images to Library !!!"
    $web.Dispose()
    How to fix this?
    Thanks

    HI,
    Is the name of the image or the sub folder name the issue?
    I have the images with the name as "ab_3f_wht_ist_small_gif.gif".  folder name "User_image"
    There are underscores on the file name, but there is no space. When I add the file from the library (using the UI), the image is getting added.
    But adding through the powershell is giving the issue.
    I have checked this:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/e810ad03-81ef-4fa6-aab8-ddc896a13ebf/getting-error-during-uploading-a-document-using-powershell?forum=sharepointdevelopmentprevious
    but did not help.
    Thanks

Maybe you are looking for

  • How to tune data loading time in BSO using 14 rules files ?

    Hello there, I'm using Hyperion-Essbase-Admin-Services v11.1.1.2 and the BSO Option. In a nightly process using MAXL i load new data into one Essbase-cube. In this nightly update process 14 account-members are updated by running 14 rules files one af

  • Superdrive not recognising DVD

    It seems I'm in a similar boat as several others in this forum. Have an eMac OSX10.3.9 with superdrive and have been burning and playing movies with no problems. In the last couple of months it will not recognise ANY DVD at all - including DVDs I hav

  • Offloading DHCP static mapping in 12.3(25)?

    According to the following: http://www.cisco.com/en/US/docs/ios/12_3t/12_3t11/feature/guide/gtdhcpsm.html ...configuring static addresses via DHCP can be accomplished from a text file found on a tftp server as of IOS 12.3(11)T. I'm running 12.3(25) o

  • Accidently Deleted Online Redo Log Files

    Dear friends Just to give a try, I deleted online redo log files from the disk after clearn shutdown (In Test Environment Not A Production Database), then i started the dabase, I know we need atleast two online redo files for database to work properl

  • Error when running the Tutorial

    I am following instructions given in the following website and built the message center. (I downloaded RSA 6.0 trial and working on it) https://www6.software.ibm.com/dw/education/r/rdynwebsites/ In my JSP page where I am retrieving the messages I hav