SetPageSize flag via VBS?

I hope you will be tolerant of a beginner who is trying to learn some basic techniques.
I am trying to create a VBS script that will print a PDF silently, with the "Choose paper source by PDF page size" option turned on.
I can see from the SDK that I need to set something like:
pp.flags = fv.setPageSize
but I can't figure out how to fit this into VBS code. I'm starting from this code provided elsewhere in this forum:
fileIn = "C:\temp\Test.pdf"              '' state the full path of the file to open
set App = CreateObject("AcroExch.App")     '' start Adobe Acrobat
'' App.Show                           '' show Acrobat or comment out for hidden mode
set AVDoc = CreateObject("AcroExch.AVDoc") '' connect to Ac Viewer
AVDoc.Open fileIn,""              '' Open a file into viewer
set PDDoc = AVDoc.GetPDDoc             '' Get the Doc opened in the viewer
set JSO = PDDoc.GetJSObject            '' Connect to Acrobat JS
'' JSO.app.alert("Hi, file is open.Press Ok for printing")  '' Display a MsgBox
'JSO.print("bUI","nStart","nEnd","bSilent","bShrinkToFit",..)
nEnd=jso.numPages-1 ''nEnd zeroBase
JSO.print False,0,nEnd,False,True   '' print with some options
JSO.closeDoc(True)
App.CloseAllDocs                  '' close all docs
App.exit
How would I add the setPageSize setting to this code?
I'll be very grateful for your help. I've tried to find help in this reference -
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/VBJavaScript.pdf
but couldn't find any pointers.
I know that someone more expert than I am would have no trouble with this at all, so I'll be especially grateful for any pointers for a beginner.

Well, after a bit more searching, I see that I need to do this:
set pp = JSO.getPrintParams()
pp.interactive = pp.constants.interactionlevel.silent
set fv = pp.constants.flagValues
pp.flags = fv.setPageSize
JSO.Print(pp)
What I can't figure out is how to specify multiple flags in VBS. If I try this:
pp.flags = (fv.setPageSize | fv.suppressCenter)
I get an "invalid character" error about the vertical bar. How can I prevent that error?
Many thanks again.

Similar Messages

  • ABR complete delta with deletion flag via delta queue (cube compartible)

    Hello
    DS 2LIS_04_P_COMP is delta enabled with ABR complete delta with deletion flag via delta queue (cube compartible)
    Is it possible to use this type of delta for ods? If yes , what kind of changes are required
    Thanks

    Hi
    ABR means
    A - After Image
    B - Before Image
    R - Reverse Image
    Since updating DSO is usually in overwrite mode it requires After Image.
    So u can use the data source with ABR delta to load into DSO (ODS).
    Cheers.

  • Insert Graphic to the Report via VBS

    Hello,
    I am trying to insert a graphic (*jpg) to the report via VBS-Script. I tried with following code:
    Call GraphObjOpen("Metafile1")
      MTAFILENAME      = "C:\test.jpg"
      MtaPosX          =28
      MtaPosY          = 78.84
      MtaRelPos        = "r-bot."
      MtaWidth         = 6.86
      MtaHeight        =4
      MtaRatioAdapt    =0
      MtaBackColor     =""
      MtaBackRGB       =0
      MtaEmbedded      =0
    Call GraphObjClose("Metafile1")
    Call picupdate
    I have 2 pages report. My problem is that the graphic appears on the second page not on the first page. doese anyone has an idea how to fix this problem?
    thnx

    Christian is correct, but if you use an English version of DIAdem, the correct command is:
        Call GRAPHSHEETSHOW("Sheet 1")
    unless you have changed the name of your sheets. If you have custom names, add the name of the sheet you are looking to edit between the " ".
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • Customer Deletion via RFC

    We would like to delete a customer (set deletion flag) via RFC. The problem is that the BAPI_CUSTOMER_DELETE calls screens which means that it cannot be called. We want to avoid doing database updates on KNA1-LOEVM because we want such deletions recorded in the change log and properly executed.
    Are there any functions in SAP which delete customers properly without user interaction?

    Here is the sample code:
    DATA: BDCDATA TYPE TABLE OF BDCDATA.
    DATA: ITAB TYPE TABLE OF BDCMSGCOLL.
    DATA: PROGRAM LIKE SY-REPID,
          WA_BDCDATA TYPE BDCDATA.
    WA_BDCDATA-PROGRAM  = 'SAPMS38M'.
    WA_BDCDATA-DYNPRO   = '0100'.
    WA_BDCDATA-DYNBEGIN = 'X'.
    APPEND WA_BDCDATA TO BDCDATA.
    CLEAR WA_BDCDATA.
    WA_BDCDATA-FNAM     = 'RS38M-PROGRAMM'.
    WA_BDCDATA-FVAL     = PROGRAM.
    APPEND WA_BDCDATA TO BDCDATA.
    CALL TRANSACTION 'SE38'  USING BDCDATA  MODE 'N'
                             MESSAGES INTO ITAB.
    For more info, please refer to SAP online help documentation http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm

  • ServerSide Event-Handler for Flag-Event possible?

    Hi!
    Is it possible to hook up some managed code into Exchange 2013 which is triggered when an E-Mail is flagged via Outlook or OWA?
    I've been fiddling around with transport-agents, but they seem to get triggered only on Mail-Transport events, which is not enough, because the E-Mail won't get through the transport-pipeline when being flagged by some user.
    Thanks for any help!
    Sascha

    No the only InProcess code you can run on the Server side are Transport Agents. You can achieve what you want to do using EWS Notification in a client Application see
    https://msdn.microsoft.com/en-us/library/office/dn458791%28v=exchg.150%29.aspx
    Cheers
    Glen

  • Programati​cally set flags in a DIAdem View

    Is there a command to set flags for a 2D axis system in a view? I would like to automate the process of setting flags for a curve, copying the points, and creating a report with a graph of the copied data and a table of that data. I can do the report I just need to be able to set the flags prgramatically once the users sets the band cursors where he/she wants.
    Thanks,
    AJL

    Hi AJL,
    Currently it is not possible to set VIEW flags via script. But, if your customer has selected the band width you know all necessary parameters.
    View.ActiveSheet.Cursor.X1
    View.ActiveSheet.Cursor.X2
    With pno you can determine the row in a data channel with contents closest to a given value. Example:
    iRowStart = pno(NameOfXChannel, View.ActiveSheet.Cursor.X1)
    iRowStop = pno(NameOfXChannel, View.ActiveSheet.Cursor.X2)
    Then you can use DataBlCopy to copy the selected area.
    Greetings
    Walter

  • ABAP to set "Switched on/off BIA indexes for queries" flag?

    Hi everyone,
    Does anyone know if the "Switch on/off BIA Indexes for Queries" can be set for a specific cube by a delivered ABAP?
    Here's my scenario. We go live with BIA next Monday 9/22. I've indexed our cubes in production BIA this past weekend and they're rolled up nightly. Until the go-live, I've manually set the "Switched Off for Queries" flag via RSDDBIAMON > BI Accelerator > Index Settings > Switch on/off BIA Indexes for Queries".
    However, one indexed cube is deleted fully every night by the flag in the full load infopackage. In testing, I saw that the BIA fact table index was fully deleted when the E and F tables of the cube were truncated, and then reindexed when the full package is loaded and rolled up. This is all ok.
    The issue is that after the delete, load and rollup, the "Switched Off for Queries" flag is not set. I have had to manually reset to off in the morning. This won't be an issue (hopefully) once we go live, but it does seem like a bug and I'll likely submit a customer message. I would think the delete, index and rollup process should not change the status of this flag.
    Does anyone know if that flag can be programatically set?
    Thanks for any advice,
    Doug

    Thanks, Vitaliy!
    I think you're exactly right. Its seems to be a bug in processing of just this specific type of index reprocessing, e.g. dropping and reindexing. The indexing process properly retains INA status on the other delta indexed cubes.
    I'm barely ABAP OO literate, but do understand enough to find, review and test the class and method code. Thanks for finding it!
    Also, I reviewed table RSDDTREXDIR and it is correct/current. It does spawn another question, though. The field ITYPE (Type of BIA Index) is consistently ICB exept for 2 cubes/indexes, which are typed as PA2 and PA9. When I check possible values on the domain, RSDDTREX_TAGGR_TYPE, it only lists ICB and ICF (Infocube - flat).
    Any idea what types PA2 and PA9 are, and why these 2 cubes would be different? From my perspective, they're basic infocubes, same as all the others.
    Thanks again,
    Doug

  • VBS-Scripting: DATAFILEIMPORT (ASCII) only imports first 20 channels

    Hello,
    I've got some problems with the automated DataFileImport via VBS-Script. The command DATAFILEIMPORT works, but it only imports the first 20 channels that are present in the data-file. The remaining 30 channels are ignored. If I import the same data file with the menu-command 'open' in the File-Menu in DIAdem-Navigator all data is imported correctly. What is the problem here?
    I'm using DIAdem 9.01 Service Pack 1.
    This is the command I'm using:
    Call DATAFILEIMPORT("D:\Messdaten\August_04\12.08.2004\Ergebnisse\2004-08-12_16-00-00_19-00-00_10sec.txt","asciiFilter",False)
    Thanks in advance
    Stefan

    Hallo Stefan,
    Problem erkannt! Du hast die STP-Datei mit einer Datendatei erstallt, die 20 Kanäle hatte und versuchst diese STP-Datei auf eine Datendatei mit 46 Kanälen anzuwenden. Hier liegt das Problem, denn eine STP-Datei kann für mehrere Datendateien nur dann benutzt werden, wenn die Struktur dieser Dateien identisch ist dh. alle Dateien die gleiche Anzahl Kanäle haben. Das dass interaktiv funktioniert liegt an einer Defaultannahme, die für Kanäle getroffen wird - aber die muss natürlich nicht stimmen (interaktiv kann das ja noch korrigiert werden per Script aber nicht). Zu diesem Problem gibt es in DIAdem 9.0 keine andere Lösung als für jede unterschiedliche Datenstruktur einen STP-File zu erstellen. In DIAdem 9.1 haben wir mit den DataPlugins eine flexible Alternative geschaffen. Infos hierzu findest du auf www.ni.com/dataplugins.
    Gruß
    br>Walter

  • 2-Sided Printing via C#

    Hi,
    I am currently having an alignment issue - the first page is correctly aligned and then every page after the first is cut off on the left side. I am trying to print double-sided (giving the user the option of long edge or short edge) onto 11x17 inch paper. NOTE: When I manually print a PDF this way it comes out 100% correct. The following code is my print method:
    private void invokeJSObjectPrint(object jsObj)
                object printParamsObj = null;
                object[] printerParam = new object[1];
                Type T = jsObj.GetType();
                printParamsObj = T.InvokeMember("getPrintParams", System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance, null, jsObj, null);
                Type printParamType = printParamsObj.GetType();
                // get property values
                object constantsProp = printParamType.InvokeMember("constants", System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Public |
                    System.Reflection.BindingFlags.Instance, null, printParamsObj, null);
                object interactionLevelProp = constantsProp.GetType().InvokeMember("interactionLevel", System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Public |
                    System.Reflection.BindingFlags.Instance, null, constantsProp, null);
                object duplexProp = constantsProp.GetType().InvokeMember("duplexTypes", System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Public |
                    System.Reflection.BindingFlags.Instance, null, constantsProp, null);
                object silentProp = interactionLevelProp.GetType().InvokeMember("silent", System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Public |
                    System.Reflection.BindingFlags.Instance, null, interactionLevelProp, null);
                object flagVals = constantsProp.GetType().InvokeMember("flagValues", System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Public |
                    System.Reflection.BindingFlags.Instance, null, constantsProp, null);
                object pSize = flagVals.GetType().InvokeMember("setPageSize", System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Public |
                    System.Reflection.BindingFlags.Instance, null, flagVals, null);
                object longEdge = duplexProp.GetType().InvokeMember("DuplexFlipLongEdge", System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Public |
                    System.Reflection.BindingFlags.Instance, null, duplexProp, null);
                object centerProp = flagVals.GetType().InvokeMember("suppressCenter", System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Public |
                    System.Reflection.BindingFlags.Instance, null, flagVals, null);
                object rotProp = flagVals.GetType().InvokeMember("suppressRotate", System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Public |
                    System.Reflection.BindingFlags.Instance, null, flagVals, null);
                // set property values
                printerParam[0] = silentProp;
                printParamType.InvokeMember("interactive", BindingFlags.SetProperty |
                    BindingFlags.Public | BindingFlags.Instance, null, printParamsObj, printerParam);
                printerParam[0] = this.ocePrint.PrinterSettings.PrinterName;
                printParamType.InvokeMember("printerName", BindingFlags.SetProperty |
                    BindingFlags.Public | BindingFlags.Instance, null, printParamsObj, printerParam);
                printerParam[0] = centerProp;
                printParamType.InvokeMember("flags", BindingFlags.SetProperty |
                    BindingFlags.Public | BindingFlags.Instance, null, printParamsObj, printerParam);
                printerParam[0] = rotProp;
                printParamType.InvokeMember("flags", BindingFlags.SetProperty |
                    BindingFlags.Public | BindingFlags.Instance, null, printParamsObj, printerParam);
                printerParam[0] = pSize;
                printParamType.InvokeMember("flags", BindingFlags.SetProperty |
                    BindingFlags.Public | BindingFlags.Instance, null, printParamsObj, printerParam);
                printerParam[0] = longEdge;
                printParamType.InvokeMember("duplexType", BindingFlags.SetProperty |
                    BindingFlags.Public | BindingFlags.Instance, null, printParamsObj, printerParam);
                object[] printParamsObjArray = { printParamsObj };
                // invoke print with the updated printer settings
                if (printParamsObj != null)
                    T.InvokeMember("print", System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.Public |
                        System.Reflection.BindingFlags.Instance, null, jsObj, printParamsObjArray);
    The program opens a PDF document, and then calls this method. The key properties are the duplex mode and the setPageSize flag value; the suppressCenter/suppressRotate seemingly have no effect. Everything works as desired except for this alignment issue. Any help/suggestions would be greatly appreciated. Thank you.

    The solution to my problem lied in my default printer settings - all of the margins needed to be set to 0. Came out perfect after doing this.

  • Binary Flags

    I'm making some games where the user needs to select/check
    several different boxes and leave several others unchecked. I have
    put it in a binary "flag" what the correct answer is. That is:
    11010
    Reading from the rights side of the number, that would be box
    1 unchecked, box 2 checked, box 3 unchecked, box 4 checked, and box
    5 checked. (There may be more boxes, but they are all unchecked and
    leading zeros don't show.)
    I've worked out th different bitwise operations to tell me if
    they are correct, incorrect, or a mixture. But I'm trying to figure
    out how to give feed back at the end. Basically I want to highlight
    all the ones that should have been checked and hide all the ones
    that should not have been checked, i.e. if there is a zero in the
    flag hide the corresponding box and if there is a one put a
    highlight color on the box.
    How does one quickly read through a binary number and see
    which are ones and which are zeros?

    Where I do things like this I tend to use a string
    representation of the binary flags. This approach is flexible - you
    can easily split it to an array - or retrieve it from an array of
    individual flags via join("") - I tend to do this- , convert it to
    a decimal number (e.g. if you wanted to use the flash binary
    operators), or just check the individual flags based on the index
    in the string. I used this approach recently to measure
    uninterrupted progression from start of a loading queue (i..e.
    queue completion without gaps) ... very simple after each character
    flag is set, its just indexOf("0") if you set a flag of "1" for a
    loaded clip.
    E.g.:
    var binString = "0110101"
    function isChecked(bin, idx) {
    return Boolean(bin.substr(idx,1))
    trace('decimal for currentbinary representation is
    :'+parseInt(binString,2))
    trace ('is third checkbox
    checked?:'+isChecked(binString,2))

  • Windows via scripting is different from frontend window

    greetings,
    this is really not a show stopper since my code works like a charm. 
    I'm curious as to why the SAP window look different when running a transaction when I log on to the frontend GUI as opposed to running that same transaction through VBS.
    version is 7100.2.8.3083
    many thanks.
    cg

    Hi lacourc,
    If you log via VBS in SAP, then SAP GUI is running in so-called classical design. This also appears to selected design, if the following to be set:
    START -> All programs -> SAP Front End -> SAP GUI Configuration -> Applications -> Add -> wscript.exe -> Open -> OK-Button
    Regards,
    ScriptMan

  • Loading new curves into report via Script

    Hello everyone!
    I tried the following to add a curve into a report via VBS-Script
    Call GraphObjNew("2D-Axis","MyGraph")
    Call GraphObjOpen("MyGraph")      
      D2AXISSYSTEM     ="one system"
      Call GraphObjNew("2D-Curve","MyCurve")
      Call GraphObjOpen("MyCurve")
        D2CCHNXNAME      ="Eigenschaften/Zeit"
        D2CCHNYNAME      ="Eigenschaften/Geschwindigkeit"
      Call GraphObjClose("MyCurve")
    Call GraphObjClose("MyGraph") 
    Call Picupdate()
    The Script runs without errors, but the Curve won't be added into the 2D-Axis Object. Does anyone know how to solve this problem?

    Hi Robert,
    Wenn I modify your code ever so slightly to operate on the channels I have in the Data Portal, and then execute the code in DIAdem 10.2, it works perfectly for me:
    Call GraphObjNew("2D-Axis","MyGraph")
    Call GraphObjOpen("MyGraph")      
      D2AXISSYSTEM     ="one system"
      Call GraphObjNew("2D-Curve","MyCurve")
      Call GraphObjOpen("MyCurve")
        D2CCHNXNAME      ="[1]/[1]"
        D2CCHNYNAME      ="[1]/[2]"
      Call GraphObjClose("MyCurve")
    Call GraphObjClose("MyGraph") 
    Call Picupdate()
    Of course, it creates a tiny little graph in the upper left hand corner of REPORT, which is probably not exactly what you want, but it is what you're asking DIAdem to do for you with the code.  I assume this is not happening for you.  What version of DIAdem are you using?
    On another note, I'd actually encourage you not to create the 2D-Axis programmatically, but rather to configure its location and appearance by hand and save a *.TDR file, which you can then load with PicLoad() or PicFileAppend().  If you leave off the first line of your code, the rest of it will then programmatically add curves and configure them as you wish.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • IPod stolen can I get it to be flagged with its serial number next time it's synced?, iPod stolen can I get it to be flagged with its serial number next time it's synced?

    iPod was stolen, is it possible to get it flagged via Serial number next time it's synced to load songs by the thief?
    Many thanks, it's my son's, was my son's, and I dunno what to do

    - If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone. If the iPod has been restored it will never show up.
    - You can also wipe/erase the iPod and have to iPod play a sound via iCloud.
    - Change the passwords for all accounts used on the iPod and report to police
    - There is no way to prevent someone from restoring the iPod (it erases it) using it.
    - Apple will do nothing
    Reporting a lost or stolen Apple product
    - iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number
    No you need to have turned on FIndMyiP{od
    The SN will only help identify the iPod as your if it is recovered.

  • Lightroom mobile lost my flagged photos

    Lightroom mobile lost my flagged photos. Hi, I am using last version of LR desktop to sync pictures to LR mobile. On my iPad mini retina I am picking pictures for future edit through flagging. But right now almost all of my flagged photos in iPad disappeard. All work which I did via iPad is lost. Have no idea what is wrong. It is not first time when this happend. So right now I do not trust flagging via LR mobile, because I do not know if it will stay, or not. Any idea? thx

    Hi!
    I will describe my whole work flow for easier description.
    I took my raw files imported to LR desktop library and made a new collection with all of them (2300 raws). After that I synced that collection with my LR mobile. From my ipad I do flagging on pictures which are just syncing to it. It takes some time to get all 2300 synced. So I work always at first 100, waiting for new to upload and flagging another 100, etc. When I went through first 500 (not exactly 500, but something around), I noticed that first 300 are comletly without any flags. All of already flagged pictures were unflagged, looking as never checked. It already happend to me before. I am not sure, but I think that it is happening if I am syncing collection, which already has some color or even flagging rating made from desktop version before. But I do not know for sure.
    So, the answer is: it is happening to my synced raw files from desktop version. And it is happening to some of first flagged pictures. For example - I went through 550 pics which were synced to my Lr mobile. 220 I flagged. But after waiting for uploading more pictures (syncing were still uploading new pics), the count of 220 flagged drop down to 120 flagged. And 100 pics were from a second unrated.

  • VB + DDE syntax to set printParams for Reader?

    I am trying to write a Windows script that will print silently, with the setPageSize option turned on, and will work with both Acrobat and Reader.
    This code, derived from other posts in this forum, works perfectly with Acrobat:
    fileIn = "C:\temp\Test.pdf"              '' state the full path of the file to open
    set App = CreateObject("AcroExch.App")     '' start Adobe Acrobat
    set AVDoc = CreateObject("AcroExch.AVDoc") '' connect to Ac Viewer
    AVDoc.Open fileIn,""              '' Open a file into viewer
    set PDDoc = AVDoc.GetPDDoc             '' Get the Doc opened in the viewer
    set JSO = PDDoc.GetJSObject            '' Connect to Acrobat JS
    set pp = JSO.getPrintParams()
    pp.interactive = pp.constants.interactionlevel.silent
    pp.pagehandling = pp.constants.handling.none
    set fv = pp.constants.flagValues
    pp.flags = (fv.setPageSize + fv.suppressCenter + fv.suppressRotate)
    JSO.Print(pp)
    JSO.closeDoc(True)
    App.CloseAllDocs                  '' close all docs
    App.exit
    I see from the SDK that something simlar should be possible with Reader via DDE (although silent printing may not be possible), but I can't find any working example of code. Is it possible to send the printparams flags setPageSize, etc., via DDE?
    Thanks for any help.

    No, there is no support for printParams with Reader and DDE.

Maybe you are looking for

  • Any way to access ddimage forensic images?

    Hi - I've been given a series of drives that supposedly contain images of a bunch of Mac HD's. The drives all contain folders and files named like this: qhq005qla1 qla51ddimage.001 qla51ddimage.002 qla51ddimage.003 qla51ddimage.029 Each drive has two

  • Fillable PDF that emails submission as uneditable/flattened

    I need to be able to create a fillable PDF that once submitted, will email a uneditable/flattened version to a given email address.  I currently have Acrobat 9 Pro. The PDF that is emailed after someone submits can be edited/altered. I need to remove

  • Which product should I buy? I want to create vintage/retro posters for band and Bar

    which product should I buy? I want to create vintage/retro posters for band and Bar

  • JMS distributed queue on response

    I have an ALSB business service sending requests to a distributed JMS queue and getting a response back from a distributed JMS queue using the correlation ID correlation pattern. This approach seems to work just fine in my tests, but the ALSB documen

  • How to get the descrption

    Hi all am retriving the matnrs from mara table into an internal table it_mara then what i need is A description of each relevant material should be retrieved from the Material Descriptions table (MAKT).  To retrieve the records, select from the table