Challenges with Compare Pdf

Hi Friends
I am using the following code to compare two versions of pdf in my web application.
I have the following challenges with it.
1) I need to suppress the Compare Dialog box that opens on calling DIGSIG:CompareDocuments.
2)How the output pdf can be shown on the client machine as this is a server code that runs on the server side.Also client machine would not have Acrobat installed on it.
3)Also how far the output pdf can be customized.Ex,Is there a possiblity to remove the first page of the output pdf.
Kindly help me out.
Thanks in advance. Refer the code below.
Function  
CompareTwoPdfFiles(ByVal OldFileName As String, ByVal NewFileName As String) As Boolean
Dim AcrobatApp As Acrobat.CAcroAppAcrobatApp = CreateObject( 
"AcroExch.App")AcrobatApp.Show()
Dim OpenPdfCount As Integer
Dim PDSaveFull As Short 
OpenPdfCount = AcrobatApp.GetNumAVDocs
Dim DocumentWasOpen As Boolean
DocumentWasOpen = (OpenPdfCount > 0)
Dim ok As Boolean
ok = 
True
  ' Open the "New" file first,
  ' so it appears on the right side in the comparison output.
  Dim NewPd As Acrobat.CAcroPDDoc  
Dim NewAv As Acrobat.CAcroAVDoc  
If ok Then
NewPd = CreateObject( "AcroExch.PDDoc")ok = NewPd.Open(NewFileName)
If ok Then
NewAv = NewPd.OpenAVDoc(NewFileName)  Else
MsgBox( "Could not open PDF file: " & NewFileName)  
End If
  End If
  ' Open the "Old" file second,
  ' so it appears on the left side in the comparison output.
  Dim OldPd As Acrobat.CAcroPDDoc  
Dim OldAv As Acrobat.CAcroAVDoc  
If ok Then
OldPd = CreateObject( "AcroExch.PDDoc")ok = OldPd.Open(OldFileName)
If ok Then
OldAv = OldPd.OpenAVDoc(OldFileName)  Else
MsgBox( "Could not open PDF file: " & OldFileName)  
End If
  End If
  If ok Then
ok = AcrobatApp.MenuItemExecute( "DIGSIG:CompareDocuments")  
If Not ok Then
MsgBox( "Could not compare files")  
End If
  End If 
  Dim NoSave As Boolean
NoSave = True 
  If ok Then
  Dim DiffAv As Acrobat.CAcroAVDocDiffAv = AcrobatApp.GetActiveDoc
Dim DiffPd As Acrobat.CAcroPDDocDiffPd = DiffAv.GetPDDoc
ok = DiffPd.Save(PDSaveFull, 
"C:\Deepak\TED Pdfs\Comparison.pdf")
  If Not ok Then 
MsgBox( "Could not save comparison output file")  
End If
  End If
CompareTwoPdfFiles = ok
  End Function
Regards
Deepak.

Hi Irosenth,
Thanks for your reply. I checked with PDFLibrary SDK, there it does not seem to have a provision to compare PDF versions.
Could you please help.
Regards
Deepak.

Similar Messages

  • Can we Compare PDF Output with CSV format

    Team,
    Can we Compare PDF Output with CSV format.
    In Excel I need to two text boxes asking us to browse the files and compare the files PDF & CSV format.
    Please suggest me if we have solution for this.
    Thanks!
    Kiran

    Hi
    I'm afraid the Excel Application does not support this function currently, I am suggesting you to take advantage of a third party component to achieve this goal.
    Thanks for your understanding.
    Best Regards
    Lan
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can adobe reader Xl pro compare pdfs with images

    Can the Adobe reader Xl pro compare pdfs with images/graphics and test?

    Claudio,
    I have documents with multiple revisions. I want to know the change from revision 1 to revision 2. Can adobe show the difference between the two revisions?
    The documents(pdfs) contain some text, graphics, flowcharts etc.

  • Problems with saving pdf as a word doc

    hello, i
    recently upgraded to acrobt x pro, and i went to convert a one-page pdf into a word doc.  i went to "file,"
    "save as," "word document, and when i went to view
    the word doc, the format/layout/font, etc. was completely garbled.  what could i be doing wrong?  thanks!

    Your problem is likely with the PDF not having the tags that provide the format information you are expecting. Such information is not needed for the PDF, but is used for the conversion back to WORD. You could try converting a file from DOC to PDF and back to DOC with both a print to the Adobe PDF printer and PDF Maker to get the format info. See how they compare and you should get the idea.

  • Compare pdf:s in Acrobat X

    I have recently updated to Acrobat X (on Win 7 X64) from Acrobat 7 (on Win XP) and can no longer compare pdf:s as I used to do.
    Comparison of pdf:s created in Word still compare as expected and generate a good report with marked differences. However, the pdf-comparison I need most is of pdf-files created from XML-files and the creation is made in Documentum. When comparing that type of pdf the compare report does not include any marks on the differences.
    Anyone who has any experience of a similar problem, or better yet, anyone who has a solution to the problem?

    No. Starting with Acrobat 9 it is no longer possible to open multiple PDF files in the same window.

  • Compare pdf's

    I have created some code in c# to compare PDF's in Acrobat V9.  I was wondering how to programmatically determine when the comparison is finished.  If you run the comparison by interactively a progress bar is shows, perhaps I can access this.  I would also like to know how to access the the summary page programmatically to determine if there are differences.  We have hundreds of pdf's to compare that need to be compared before and after codes changes. Doing this interactively would be painful.
    Some code snippets so it is understood how I am attacking the problem currently.
                PdOldDoc.Open(oldFile);
                PdOldDoc.OpenAVDoc("old");
                PdNewDoc.Open(newFile);
                PdNewDoc.OpenAVDoc("new");
                object activeDoc = AdobeApp.GetActiveDoc();
                AdobeApp.MenuItemIsEnabled("DIGSIG:CompareDocuments");
                bool ret = AdobeApp.MenuItemExecute("DIGSIG:CompareDocuments");
                Sleep(10000);  //For now just wait 10 seconds until a better way can determined to figure out when the compare process finishes
                AdobeApp.CloseAllDocs();

    So there are no .Net ways to compare 2 files.  I have 90% of the comparison working and seems strange that I can't silently compare 2 documents and create a 3rd document with the differences.
    Through .Net and the Acrobat.dll I can:
    1. open the old file
    2. open the new file
    3  open a compare dialog with the 2 file names populated
    4. *Manually select my document comparison type and Manually select OK in the Compare dialog
    5. Save the compared file through .Net
    6. Close all my Acrobat windows through .Net.
    Is there no way to complete step 4 via .Net and the acrobat.dll?
    Would another much more $$$ option be to go to a LiveCycle module and pay 40K+ for a module to compare a batch PDFs?
    Thanks for any insight you can provide.

  • Compare PDF Docs From The Command Line

    Hi All,
    I love the compare PDF that you get in Adboe professional - Its awesome.
    Does anyone know if you can script this to diff an entire folder of pdfs?
    I m happy to program this but do not know where to start / where the API is and whether it is possible
    Thanks

    Thanks Aandi - Very helpfull
    You mentioned: based on scripting through OLE and JavaScript
    How exactly do you do this though :( - Where is the DOM API? What are the methods available?
    Hoe else can you compare PDFs in a bulk fashion with the output being as good as Adobes?
    I have adobe distiller s well if thats helpful

  • Compare PDF functionality API

    Hi All,
    Do you know how we call Adobe compare PDF utility in Java program.
    I have n no of files to compare. Is there option to call Adobe compare PDF in my java program. So that I can write a looping for all files.
    Appreciate your answer...

    Thanks Test Screen Name..No. I do not want in server. in my desk top. I have installed Adobe acrobat pro X in my desktop. What I want to do is i have 50 PDF to be compared with a single original PDF. I want to compare those 50 PDF without comparing one by one. I want to compare in a single time. So if any API is there, I can write a code by looping through 50 PDF's. Hope you got it..please let me know if you need more information..

  • Compare PDFs in Batch Mode

    I currently have Acrobat X Pro and I'm curious if it is possible to use a command prompt to compare 2 PDFs and have the output\report emailed or copied out somewhere for review? We're trying to automate some daily processes where compare PDFs from the prior day.  Any suggestions are welcome if Acrobat Pro X is unable to accomplish this?  Thanks!
    Michael

    This happens on Acrobat 8 Pro on Windows XP too - the text only compare in side by side mode correctly traps the redline differences but highlights non-changed text in a very strange fashion.
    It appears to be a bug to me as when you open the comments list and click on the highlight it appears as with a type of 'Indeterminate' and the annotation 'Matching text on page 1 of other document'. When I click on the comment I get an Acrobat error dialog box with the text:
    'There was an error processing an annotation or link. There was a problem reading this document (14).'
    And I can't seem to delete the comments (presumably as Acrobat is failing to read the comments).
    Very irritating. Worse, Acrobat 9 (Mac) has no way to preconfigure the compare so a 2.3MB compare in v8 is now 13+MB in v9 and every table edge (in a 150pp doc) is highlighted as different. Otherwise the v9 compare appears very good for on screen in v9 except it doesn't degrade very well to v8 and there is no side-by-side redline mode I can see.
    Will be running v8 for a while yet.

  • How do I display the web address with Adobe PDF Reader 10.1.1 & IE 9 x64?

    Until a week ago, I was using IE 9 32-bit version together with Adobe PDF Reader 10.1.1.   When I would try to open a PDF file from within the browser, it would and the Web Address would continue to display at the top of the window while browing the PDF document. I could then continue using IE 9 and move on to other pages and etc...
    Now, I have swtiched to using the IE 9 64-bit version. What happens now is that when I enter an address in the web browser and it's a direct link to a PDF file example: https://www.technicalindicatorindex.com/newsletter/bpdf/TII_Newsletter _1686a_10.11.11_7055475115.pdf ), it opens up with no problems, but I no longer see the IE 9 Web Address shown anywhere. So in essence, that page becomes a Adobe PDF program window and I loose my IE 9 access. I guess the PDF files are no longer displayed within the browser (althought I have it check ON).
    Am I missing something?

    I did write there, but no replies
    I guess that with Adobe Reader 10.1.1 running with IE 9.x in x64 bit mode, you cannot open the PDF within explorer, as it does it outside it as a separate Window?
    Correct?

  • Problem with preview PDF files on Windows 7 32bit

    Hello,
    in my office I have a problem with preview PDF files on my computers. The files are allright, but if I select a file and click on preview mode after ~ 10sec operation system write something "Preview this file is corrupt for PDF Preview Handler wrong". On other 64bit computers with same programs the preview is work. I try uninstall all Adobe soft (Reader, Flash), clean all Adobe data from folders in root and in register, but it is not solve this problem. On Microsoft forums wrote me, that the problem is probably with AR plugin.
    So, can someone help me?
    Config PC:
    Windows 7 32/64bit Pro
    Intel i3, 4GB
    Adobe Reader 11.0.5
    Adobe Flash Player 15 ActiveX
    Adobe Flash Player 15 plugin
    Preview Handler Surrogate Host ver.: 6.1.7601.17514
    Thank you for help.

    I think I figured it out after reading other forums. Thanks!

  • Problem with Copying PDFs to any application other than iBooks

    OK here is my problem,
    I used to be able to associated PDFs with other PDF readers (via iTunes > APPS > File Sharing). I just dragged and dropped and all was right in my world. However, all of a sudden this stopped working. I have no clue as to what caused this problem to arise. The only thing I remember 'doing' was adding some new apps.
    I cannot use the PDFs through iBook, well I can but it doesn't meet my needs (highlighting, copying and pasting and adding notes). So instead I want to use PDF HD. I used to have on PDF Masker and Good Reader, but neither does what I want.
    Suggestions?

    Hello Sin K,
    so proxy and Tomcat are located on different machines as well? Is the proxy able to commuicate with the Tomcat on the configured internal ports and is the proxy able to lookup the hostname you configured for the Tomcat?
    For the connector, the proxyName and proxyPort should be the parameters the client uses to call APEX. So if your clients should call via http://proxyserver:8080/testsin/apex the settings would be
    proxyName=proxyserver
    proxyPort=8080Reason for this is that applications (e.g. the APEX Listener) generate there URL references with these parameters.
    But does your proxy actually serve on port 8080? And is that port accessible by clients? Do clients accept cookies from that server?
    In my case, there is only one 302 which redirects to http://host:port/apex/f?p=4500:1000:sessionid which is correct.
    If you look into your first post request in firebug, what's in the request header?
    -Udo

  • Firefox Crashes Consistently after closing tab with a pdf file displayed. Signature = LookupNPP Already tried updating Adobe Reader with no remedy.

    While using www.airset.com, within File App, I open a pdf file (which opens in a separate window, then close the separate window with the pdf fil ==> Firefox crashes consistently (with AirSet Connector Extension enabled). Crash does not occur if AirSet Connector is disabled. Gary

    Since it doesn't seem like you are looking for support, locking this thread.

  • Need Help with this PDF generation

    Greetings,
    Our company had a subcontractor (that is no longer
    available) create a small system for a client that allows the
    client to input some text in a flash form, and the system places
    the text at a certain spot on a previosly created PDF document. For
    80% of the users, this works perfectly and then can print and save
    the customized pdf document. For 20% of users, they can see and
    print the customized pdf, but when they save it, there is no
    customization (area is blank). Can anyone help us understand why
    this happens, and how to fix?
    HERE ARE DIRECT NOTES FROM OUR CLIENT:
    Users are able to input their customized info.
    The customized info shows up in the PDF on the brochure.
    Users can print the brochure with the customized info.
    Users can save the BLANK PDF (without their info)
    Users can NOT save the PDF with their info in it.
    The exact message is in the top of the window with the PDF
    brochure and says "please fill out the following form. You can not
    save data typed into this form. Please print your completed form if
    you would like a copy for your records."
    Here is the input
    form, feel free to test.
    When you input into the brochure1.cfm Form, it sends the data
    to
    http://www.caduceuswebs.net/brochure1output.cfm
    , which then spanwns the customized pdf to open.
    If you want to see the native pdf, it is here:
    CLICK
    HERE
    HERE IS THE CODE FOR BROCHURE1.CFM
    <CFFORM ACTION="brochure1output.cfm" METHOD="POST"
    ENABLECAB="YES" format="flash" width="470" height="550">
    <div align="center">
    <table width="470" border="0" align="center"
    cellpadding="0" cellspacing="0" bordercolor="#990066">
    <tr>
    <td><cfinput type="TEXT" name="name" id="name"
    label="Name" maxlength="60"></td>
    </tr>
    <tr>
    <td><CFINPUT TYPE="TEXT" NAME="address1"
    id="address1" label="Address" hspace="470">
    </P></td>
    </tr>
    <tr>
    <td><CFinput type="text" name="address2"
    id="address2" label="Address Cont." /></td>
    </tr>
    <tr>
    <td><CFinput type="text" name="state" id="state"
    label="City / State"/></td>
    </tr>
    <tr>
    <td><CFinput type="text" name="zip" id="zip"
    label="Zip Code"/></td>
    </tr>
    <tr>
    <td><CFinput type="text" name="phone" id="phone"
    label="Phone Number"/></td>
    </tr>
    <tr>
    <td><table width="470" border="0" cellspacing="0"
    cellpadding="0">
    <tr>
    <td width="100"><img src="img/transparent.gif"
    width="100" height="1" border="0" /></td>
    <td width="373"><cfinput type="SUBMIT"
    value="Generate Customized Brochure 1" name="Submit"></td>
    </tr>
    </table></td>
    </tr>
    </table>
    </div>
    </CFFORM>
    HERE IS THE CODE FOR BROCHURE1OUTPUT.CFM:
    <CFOUTPUT><CFSET
    date="#DateFormat(now())#"></CFOUTPUT>
    <CFSETTING ENABLECFOUTPUTONLY="YES"
    SHOWDEBUGOUTPUT="NO">
    <CFCONTENT TYPE="APPLICATION/vnd.fdf">
    <CFOUTPUT>%FDF-1.2
    1 0 obj <<
    /FDF <<
    /Fields
    <<
    /T(name)
    /V(#form.name#)
    >>
    <<
    /T(address1)
    /V(#form.address1#)
    >>
    <<
    /T(address2)
    /V(#form.address2#)
    >>
    <<
    /T(state)
    /V(#form.state#)
    >>
    <<
    /T(zip)
    /V(#form.zip#)
    >>
    <<
    /T(phone)
    /V(#form.phone#)
    >>
    /F(
    http://www.caduceuswebs.net/pdfs/brochure1.pdf)
    >>
    >>
    endobj
    trailer
    <</Root 1 0 R>>
    %%EOF
    </CFOUTPUT>

    rogers42 wrote:
    Hi,
    Thanks for the suggestion.
    While getting rid of the ";" helps, but the output of the select statement is not displayed?When you do a SELECT statement in PL/SQL, you have to select the results into variables or arrays.
    Try something like this:
    DECLARE
         CURSOR C1 IS
                       SELECT  TABLE_NAME
                FROM    DB_MGMT.CTRL_TAB_RETENTION
                WHERE   RETENTION_PERIOD_IN_MONTHS = 11
                AND     rownum                  < 2;
         min_dt_skey    NUMBER;
         max_dt_skey    NUMBER;
         stmt            VARCHAR2 (100);
    BEGIN
        FOR i IN C1
         LOOP
            -- dbms_output.put_line('Table Name: ' || i.TABLE_NAME);
            stmt :='SELECT min(DT_SKEY), max(DT_SKEY) FROM DWH_RSRC_PERF.' || i.TABLE_NAME;
            dbms_output.put_line(stmt);
            EXECUTE IMMEDIATE stmt
             INTO min_dt_skey, max_dt_skey;
         dbms_output.put_line (  min_dt_skey   || ' = MIN (dt_skey), '
                        || max_dt_skey   || ' = MAX (dt_skey) for table '
                        || i.table_name
        END LOOP;
    END;

  • Find text and replace with a pdf stored in the same folder

    Hello,
    I have a catalog that is updated every so often.  I have written a script to find/replace the text from a .txt file.  but i have a pdf that i want to insert that is part of it as well.  Inside the .txt file i have the name of the document.  and the pdf is stored inside the same folder as the original .indd and the .txt file.
    can someone point me at some examples on how this could be done. 
    Thanks

    I use this script: it puts a txt in a text frame, check the overflow and find/replace some words with a pdf. Hope this is helpful.
    Paolo
    /************************FLOW************************************************
    * This function looks for Overflows in the story and either resizes the           *
    * frame to the size of the margins (if necesary) or adds a new page and     *
    * a new frame, which is then linked to the previous frame.esizes the           *
    function flow(){
        for(var i = 0; i < app.activeDocument.pages.count(); i++)
            for(var b = 0; b < app.activeDocument.pages[i].textFrames.count(); b++)
                if(app.activeDocument.pages[i].textFrames[b].overflows == true )
                    var currentPage = myDocument.pages[i];
                    var myPageNo = currentPage.name;
                    var currentFrame=currentPage.textFrames[b];
                    var e =currentFrame.geometricBounds[0];
                    var f =currentFrame.geometricBounds[1];
                    var g =currentFrame.geometricBounds[2];
                    var h =currentFrame.geometricBounds[3];
                    if(myPageNo %2==0){
                        var myMargins =currentPage.marginPreferences;
                        var a = currentPage.bounds[0]+myMargins.top;
                        var b = currentPage.bounds[1]+myMargins.right;
                        var c = currentPage.bounds[2]-myMargins.bottom;
                        var d = currentPage.bounds[3]-myMargins.left;
                    else{
                        var myMargins =currentPage.marginPreferences;
                        var a = currentPage.bounds[0]+myMargins.top;
                        var b = currentPage.bounds[1]+myMargins.left;
                        var c = currentPage.bounds[2]-myMargins.bottom;
                        var d = currentPage.bounds[3]-myMargins.right;
                    if (g < c)
                        currentFrame.geometricBounds = [a,b,c,d];
                    else if (g==c){
                    var newPage = myDocument.pages.add(LocationOptions.AFTER, currentPage);
                    currentPage = newPage;
                    myPageNo = currentPage.name;
                    if(myPageNo %2==0){
                        var myMargins =currentPage.marginPreferences;
                        var a = currentPage.bounds[0]+myMargins.top;
                        var b = currentPage.bounds[1]+myMargins.right;
                        var c = currentPage.bounds[2]-myMargins.bottom;
                        var d = currentPage.bounds[3]-myMargins.left;
                        var newFrame = currentPage.textFrames.add({geometricBounds:[a,b,c,d]});
                        newFrame.textFramePreferences.textColumnCount = 7;
                        newFrame.previousTextFrame = currentFrame;
                    else{
                        var myMargins =currentPage.marginPreferences;
                        var a = currentPage.bounds[0]+myMargins.top;
                        var b = currentPage.bounds[1]+myMargins.left;
                        var c = currentPage.bounds[2]-myMargins.bottom;
                        var d = currentPage.bounds[3]-myMargins.right;
                        var newFrame = currentPage.textFrames.add({geometricBounds:[a,b,c,d]});
                        newFrame.textFramePreferences.textColumnCount = 7;
                        newFrame.previousTextFrame = currentFrame;
    //************************************END FLOW FUNCTION*********************************************
    /*******************TextPlacer***************************
        this script will add a text file in an existing text frame
        Questo file deve essere copiato nella cartella Script di InDesign
    function myGetBounds(myDocument, myPage){
    var myPageWidth = myDocument.documentPreferences.pageWidth;
    var myPageHeight = myDocument.documentPreferences.pageHeight
    if(myPage.side == PageSideOptions.leftHand){
    var myX2 = myPage.marginPreferences.left;
    var myX1 = myPage.marginPreferences.right;
    else{
    var myX1 = myPage.marginPreferences.left;
    var myX2 = myPage.marginPreferences.right;
    var myY1 = myPage.marginPreferences.top;
    var myX2 = myPageWidth - myX2;
    var myY2 = myPageHeight - myPage.marginPreferences.bottom;
    return [myY1, myX1, myY2, myX2];
    /*******************ImagePlacer***************************
        this script will addimages to the document by
        substituting them with the name of the image file
        between @s (file format included[@mypic.bmp@]),
        selecting them from a specified file (see below)
        and applying object styles to them, as well as
        applying the right tab i necesary.
        It then looks for overflows in the document. If an
        overset is found, it will resize to margin size the
        text frame and if overset continues, it will add a
        new page and frame, which then will be linked
        to the previous frame, allowing the story flow.
        Questo file deve essere copiato nella cartella Script di InDesign
    //Creates a new document using the specified document preset.
    //Replace "myDocumentPreset" in the following line with the name
    //of the document preset you want to use.
    var myDocument = app.documents.add(true,app.documentPresets.item("Preset"));
    //If the active document has not been saved (ever), save it.
    if(app.activeDocument.saved == false){
    //If you do not provide a file name, InDesign displays the Save dialog box.
    app.activeDocument.save(new File("/Users/Paolo/Desktop/Documento.indd"));
    function main()
    var myDocument = app.documents.item(0);
    var myPage = myDocument.pages.item(0);
    var myTextFrame = myPage.textFrames.add({geometricBounds:myGetBounds(myDocument,myPage)});
    myTextFrame.textFramePreferences.textColumnCount = 7;
    myTextFrame.place(File("/Users/Paolo/Desktop/text.txt"));
    //Place a text file in the text frame.
    //Parameters for TextFrame.place():
    //File as File object,
    //[ShowingOptions as Boolean = False]
    //You'll have to fill in your own file path.
    //Define GREP search
    var grepFind ="@@@.+@@@";
    //Folders name where there are pdf, must be in the same place of the file
    var myFiguresFolder = "testatine";
    // Applied paragraph style
    var myPStyle = myDocument.paragraphStyles.item("Paragraphstyle");
    var NextPStyleCS = myDocument.paragraphStyles.item("Par_Style");
    var NextPStyleEN = myDocument.paragraphStyles.item("Par_Style_en");
    var NextPStyleDE = myDocument.paragraphStyles.item("Par_Style_de");
    // Applied text style
    var myCStyle = myDocument.characterStyles.item("text");
    //Applied object style
    var myOStyle = "";
    var oStyle_1 = myDocument.objectStyles.item("Pictures");
    var oStyle_2 = myDocument.objectStyles.item("Pictures");
    var oStyle_3 = myDocument.objectStyles.item("Pictures");
    //MEASUREMENTS
    var maxWidth = 467; //Maximum width of an image
    var maxHeight = 666; //Maximum Height of an image
    var colWidth = 468; //Width of the main columb (340pt) + maximum Tab (128pt)
    var maxTab = 0;
    var xTab;
    var xtTab;
    var minTWidth = 340; //any image with a width below this will have the maximum Tab (maxTab) applied.
    var PWidth; //Width of the Picture
    var PHeight;//Picture Height
    var myTotal;
    //---------------------------------ALERTS---------------------------------\\
    var notSaved = "Documento non salvato; devi prima salvare il documento";
    var noFolder = "No such folder exists; "+myFiguresFolder;
    var noImageMessage = "No Images were found";
    var finished = " immagini sostituite"
    //---------------------------------ALERTS---------------------------------\\
    /************************END OF STORY*****************************************
    *  The object of this bit of programming is to add an empty paragraph break *
    *  at the end of the story, in order to make the actual script work in the case   *
    *  that the LAST paragraph were a TABLE                                                              *
    var findEnd_of_Story = "\\r(?=\\z)" //GREP for End of Story                        //
    app.findGrepPreferences = NothingEnum.nothing;                              //
    app.changeGrepPreferences = NothingEnum.nothing;                         //
    app.findGrepPreferences.appliedParagraphStyle = myPStyle;              //
    app.findGrepPreferences.findWhat = findEnd_of_Story;                      //
    var fItems = myDocument.findGrep();                                              //
    var myC = fItems.length-1;                                                             //
    if (fItems =!0){                                                                              //
        do{                                                                                             //
            if (fItems.appliedParagraphStyle = myPStyle){                          //
                cItem = fItems[myC]                                                          //
                app.changeGrepPreferences.changeTo = "$0\\r";                  //
        myDocument.changeGrep();                                                       //
    myC--;                                                                                           //
    while (myC >= 0);                                                                       //
    try{
    var myDocPath = myDocument.filePath; //Complete Path to the Current Document
    catch (myError){
    alert (notSaved);
    //throw("");
    return;
    var myFFldr =Folder(myDocPath+"/"+myFiguresFolder); //Complete Path in which the figures to be placed should be found
    if(myFFldr.exists){
        flow();
        app.findGrepPreferences = app.changeGrepPreferences = null;
        app.findGrepPreferences.findWhat = grepFind;
        var myFoundItems = app.activeDocument.findGrep();
        var myCounter = myFoundItems.length-1
        myTotal = myCounter+1;
        for (i = myCounter; i >=0; i--) {
            var myName = myFoundItems[i].contents.replace (/@/g, "");
            app.selection = myFoundItems[i];
            var fFig=app.selection[0];//Found text for
            var cPStyle= fFig.appliedParagraphStyle;
            var myFile = new File( myFFldr + "/" + myName);
            if (myFile.exists) {
                var cFig = fFig.place(myFile);
                var sFig = cFig[0].parent;
              switch (cPStyle){
                  case (myPStyle):
                  myOStyle =oStyle_1;
                  PWidth = sFig.geometricBounds[3] - sFig.geometricBounds[1];
                  PHeight = sFig.geometricBounds[2] - sFig.geometricBounds[0];
                  if (PWidth >= minTWidth){
                      xTab = (colWidth-PWidth);
                  else{
                      xTab =maxTab;
                  var currentPar = sFig.parent.paragraphs.item(0);
                  currentPar.leftIndent = xTab;
                  var nextPar= currentPar.insertionPoints[-1].paragraphs[0];
                  var nextParStyle = nextPar.appliedParagraphStyle;
                  if (nextParStyle == NextPStyleCS||nextParStyle ==NextPStyleEN||nextParStyle == NextPStyleDE){
                      xtTab = xTab
                  else {
                      xtTab = nextPar.leftIndent;
                  nextPar.leftIndent =xtTab;
                  sFig.appliedObjectStyle = myOStyle;
                  cPStyle = "";
                  break;
                  case (myPStyle):
                  myOStyle = oStyle_3;
                  sFig.appliedObjectStyle = myOStyle;
                  cPStyle = "";
                  break;
                  default:
                  myOStyle = oStyle_2;
                  sFig.appliedObjectStyle = myOStyle;
                  cPStyle = "";
                  break;
              var oFig = sFig;
              sFig = ""
    flow();
      //alert(myTotal + finished);
    else{
        alert(noFolder);
    var myDocument = app.documents.item(0);
    //Clear the find/change grep preferences.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    //Set the find options.
    app.findChangeGrepOptions.includeFootnotes = false;
    app.findChangeGrepOptions.includeHiddenLayers = false;
    app.findChangeGrepOptions.includeLockedLayersForFind = false;
    app.findChangeGrepOptions.includeLockedStoriesForFind = false;
    app.findChangeGrepOptions.includeMasterPages = false;
    //Regular expression to use
    app.findGrepPreferences.findWhat = "<(.+?)>";
    //Apply the change to 24-point text only.
    //app.findGrepPreferences.pointSize = 24;
    //app.changeGrepPreferences.underline = true;
        var myFoundItems = app.activeDocument.findGrep();
        var myCounter = myFoundItems.length-1
        myTotal = myCounter+1;
        //alert("occorrenze" + myTotal);
        app.changeGrepPreferences.changeTo= "$1";
        app.changeGrepPreferences.appliedCharacterStyle= myDocument.characterStyles.item("head");
       myDocument.changeGrep();
      for (i = myCounter; i >=0; i--) {
            var myName = myFoundItems[i].contents.replace ("/</g", "");
            var myName = myFoundItems[i].contents.replace ("/>/g", "");
            app.selection = myFoundItems[i];
            var fFig=app.selection[0];//Found text for
            var myCStyle = myDocument.characterStyles.item("head");
            app.selection[0].applyCharacterStyle(myCStyle, true);
    //Clear the find/change preferences after the search.
    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    main();

Maybe you are looking for

  • My iphone 4s doesn't recognize my SIM card

    I went to trade 4S for 5C and couldn't get credit for it because I couldn't wipe phone. Can I get a functioning SIM card to trade in otherwise good phone? It looks brand new and is a year old.

  • Last conditon type is not active in the pricing procedure

    Hi gurus, In the standard system, when there are multiple Condition types exists in the pricing procedure for the same condition class ( Example : Price) then the value of the last condition type should be active and rest all should be inactive. Wher

  • More Find/Change Issues !!

    by script I'm going to create and setup new doc, use a dialog to place a text file, and remove content from the text, format and save.<br /><br />the text file contains old msword-to-pagemaker format tags that I need to delete. the tags are in this f

  • New to CS 6....how can I create default "print document" letter-size artboard?

    New to CS 6....how can I create  a default "print document" letter-size artboard ?

  • Conditional action script not executing

    I have four buttons, Q1, Q2,Q3,Q4.  the script for each works fine:  the variable (ex. Q1) is set equal to 1 and the other functions perform as scripted.  When all four buttons are clicked on and equal to 1, another script (Slide_End) is supposed to