Reach a page of other document

Hello,
I have a problem with the link on a PDF file.
I like to put a link for "fichier1.pdf" to the page n of "fichier2.pdf"
but my link to the first page of file2.
What should I add my code to work properly (something AVPageView surely be how to define it)?
Thank you
Here is my code:
ASAtom pathType = ASAtomFromString("Cstring");ASFileSys fileSys = ASGetDefaultFileSysForPath(pathType,
"C:/fichier2.pdf");ASPathName pathLaunchFile = ASFileSysCreatePathName(fileSys,pathType,
"C:/fichier2.pdf", NULL);PDFileSpec laFile = PDFileSpecNewFromASPath(myPDDocc,fileSys,pathLaunchFile,NULL);
PDAction linkAction;
AVDoc newDoc = AVDocOpenFromFile (pathLaunchFile, fileSys, NULL);
PDDoc newPDDocc = AVDocGetPDDoc(newDoc);
AVPageView pageView = AVDocGetPageView(DocCourant);
AVPageView myPageView = AVDocGetPageView(newDoc);
AVPageViewGoTo(myPageView,pNum);
PDViewDestination pdvDes = AVPageViewToViewDest(myPageView,ASAtomFromString(
"XYZ"),newPDDocc);
linkAction = PDActionNewFromDest(newPDDocc,pdvDes,myPDDocc);PDLinkAnnotSetAction(annot,linkAction);

Variables are defined higher in the code.
Here is a more complete extract of the code.
//Create a HiliteEntry object and set its attributes
  HiliteEntry hilite;
  hilite.offset = position;
  hilite.length = nbreMot;
  //memorise le numero de la page courante
  AVPageView currentPageView = AVDocGetPageView(currentAVDoc);
  ASInt32 pageNum = AVPageViewGetPageNum(currentPageView);
  page = PDDocAcquirePage(currentPDDoc, pgNum);
  PDTextSelect textSelection = PDTextSelectCreateWordHilite(page,&hilite, 1);
  AVDocSetSelection(currentAVDoc, ASAtomFromString("Text"),(void *)textSelection, true);
  AVDocShowSelection (currentAVDoc);
  PDTextSelect ts = (PDTextSelect) AVDocGetSelection(currentAVDoc);
  PDTextSelectGetBoundingRect(ts, &fr);
  annot = PDPageCreateAnnot (page, ASAtomFromString("Link"),(const ASFixedRect *) &fr);
  /* on ajoute le lien à la page */
  PDPageAddAnnot(page,-2, annot);
  char foliodest[32];
  ASInt32 destination = 0;
  if ( ((pageDest+1) >= posRomain) && ((pageDest+1) <= posFinRomain))
   destination = pageDest  - (posRomain - prePosRomain) + 1;
  else
   destination = pageDest - (posArabe - prePosArabe) + 1;
  sprintf(foliodest,"%d",destination);
  ASInt32 pNum = pageDest;
  PDLinkAnnotBorder linkBorder;
  strcpy(ligneBuffer," ");
   AVDoc DocCourant = AVAppGetActiveDoc();
   PDDoc myPDDocc = AVDocGetPDDoc(DocCourant);
   char pdfPathChar[1024];
   ASFile asFile = PDDocGetFile (currentPDDoc);
   ASPathName pdfpath = ASFileAcquirePathName (asFile);
   char keys[] = "1234567890";
   sprintf(pdfPathChar,"%s",pdfpath);
   int posEan;
   posEan = strcspn (pdfPathChar,keys);
   strncpy (pdfPathChar,pdfPathChar,posEan);
   pdfPathChar[posEan]='\0';
   creerFichierLogLien(pdfPathChar);
   char pathFichier2[1024];
   strcpy(pathFichier2,pdfPathChar);
   strcat(pathFichier2,"fichier2.pdf");
   ASAtom pathType = ASAtomFromString("Cstring");
   ASFileSys fileSys = ASGetDefaultFileSysForPath(pathType,pathFichier2);
   ASPathName pathLaunchFile = ASFileSysCreatePathName(fileSys,pathType,pathFichier2, NULL);
   PDFileSpec laFile = PDFileSpecNewFromASPath(myPDDocc,fileSys,pathLaunchFile,NULL);
   PDAction linkAction;
   AVDoc newDoc = AVDocOpenFromFile (pathLaunchFile, fileSys, NULL);
   PDDoc newPDDocc = AVDocGetPDDoc(newDoc);
   AVPageView pageView = AVDocGetPageView(DocCourant);
   AVPageView myPageView = AVDocGetPageView(newDoc);
   AVPageViewGoTo(myPageView,pNum);
   PDViewDestination pdvDes = AVPageViewToViewDest(myPageView,ASAtomFromString("XYZ"),newPDDocc);
   AVPageViewUseThisDestination(myPageView, pdvDes, fixedZero);
   linkAction = PDActionNewFromFileSpec(myPDDocc,ASAtomFromString("Launch"),laFile);
   PDLinkAnnotSetAction(annot,linkAction); 

Similar Messages

  • [AS] Duplicate page to other document

    I need to duplicate a page from one document into another (Applescript, CS5). I can do it, but the new page always is placed next to the last page, attached on the same spread (like a gatefold). But I don't want it to be attached like that, it would be easier if it could create a new spread on its own (which is the way it seems to work when done by hand). Using "after spread -1" doesn't do anything different than "after page -1".
    duplicate every page of otherDoc to after page -1 of doc1

    From one doc of single page spreads to another…
    tell application "Adobe InDesign CS5"
         set docA to the active document
         set docB to the last document
         -- To end of single page spreads
         duplicate last page of docA to ¬
         after last page of docB
    end tell
    From a single page doc to one with spreads left page…
    tell application "Adobe InDesign CS5"
         set docA to the active document
         set docB to the last document
         -- To first page of new spread
         duplicate last page of docA to beginning of ¬
         (make new spread at end of docB)
    end tell
    From a single page doc to one with spreads right page…
    tell application "Adobe InDesign CS5"
         set docA to the active document
         set docB to the last document
         -- To last page of new spread
         duplicate last page of docA to end of ¬
         (make new spread at end of docB)
    end tell
    Oh I see you mention every…
    tell application "Adobe InDesign CS5"
         set docA to the active document
         set docB to the last document
         -- All spreads to end
         duplicate every spread of docA to ¬
         after last spread of docB
    end tell

  • Open to the first page in a document

    Adobe Acrobat, reader and creator, both default to open a multiple page document, showing the page that was highlighted at the time that the document was saved. As a result, the next document viewer will see a page somewhere in the middle of the document when first opening that document. If that next viewer is not aware of where this page is in relation to the rest of the document he will not scroll up to the top to view the document from the first page. We have this happening on a regular basis with users who are not aware of the page thumbnails view option. Is there a way to set Acrobat (reader and creator) to default to always open to the first page in a document regardless of what page it was on at time the document was saved?

    For Acrobat X I went to Tools - Pages - and the delete choice was grayed out.  I thought I could get the same result by using the Print to Adobe PDF command.  From any other application I can print to Adobe PDF, just not in Acrobat.  Does Acrobat X not let you do this, or is it just on mine?  And if it is only on mine, what do I do to fix it?  By the way, I am able to delete pages from other documents, just not the particular document I am currently working with.
    Any other suggestions anyone?

  • Pages will no longer let me open files that I have previously downloaded, worked on and then saved on my mac. However it will let me open pages documents that I have started from new. I need the other documents to open and can't figure it out. PLEASE

    Pages will no longer let me open files that I have previously downloaded, worked on and then saved on my mac. However it will let me open pages documents that I have started from new. I need the other documents to open and can't figure it out. PLEASE

    I just got my mac a month ago so go easy on me but I was just working with the pages that was already on it, and then today I know it updated, and now I am unable to open a lot of my documents!:(  Idk what you mean by the icloud version lol sorry! As for the version, when I open pages from my apps and click 'about' it says version 5.1? And when I open the document it just goes grey and kind of blinks and doesnt open? No error message or any indication of why it will not open now when I for sure have opened it in the past! Andddd for the OS X I think it is 10.9.1 ??

  • Pages 5.2 opens all kinds of other document formats (even old .doc  Versions), but cannot open Pages 08 etc. of its own kind? I have to use NeoOffice to open my documents of many years of work. Is there an option to organize a corporate com

    Pages 5.2 opens all kinds of other document formats (even old .doc  Versions), but cannot open Pages 08 etc. of its own kind?
    I have to use NeoOffice to open my documents of many years of work.
    Is there an option to organize a corporate complain to Apple to be heard?

    We have been doing nothing but for 10 months.
    Here is the response:

  • How can I attach j-pegs and other documents to an email unopened and stop each them taking up a whole page of my email ?

    How can I attach j-pegs and other documents to an email unopened and stop each them taking up a whole page of my email ?

    In addition to the last poster's suggestion  -  just so you know, it also depends on the email program the recipient uses as to how they will see any attachments - for instance, when I am using my Yahoo Mail, I am absolutely unable to view any attachment within the browser window - Yahoo forces me to download it; there is no way for me to check it (like a preview) to see if I want to download it or not.
    And, FWIW: the window shown in the screenshot does not show on my version of Mail 5.1 (which is the latest for 10.7.2); the only one similar shows when viewing a message received with an attachment, not while sending one. So that must be a different version.

  • How do I get headers to reproduce on other pages in the document?

    I've spent about 30 minutes on this problem and I'm running out of time. I opened my newsletter project in new Pages and things are not as they should be in the template. I'll leave the griping to other people. They're doing a great job expressing my frustration. I just want to know how to fix this simple problem:
    The header info on Page 1 is no longer showing up on Page 2. There is Lorem Ipsum style text there now. And the date is wrong. Same issue with the footers. The hole point of having headers and footers for me is to edit copy in one place that propogates through the entire document. I suspect the new ability to spawn new headers & footers per page is the culprit. A drop down on the Page 1 header reads "Editing header for pages 1-2", but this isn't so. Page 2 clearly has a separate header. No changes to Page 1 are reflected in Page 2. I'm stumped. Anybody know how to tell Pages to fix this? I've even tried deleting the Page 2 header, but still can't find a way to get the Page 1 header to reproduce there.

    I've got a similar problem but somewhat backwards to yours.
    I have a new MacBook Pro 15 Retina, running Yosemite.  I am using Pages to rewrite my resume from scratch, based on past versions and notes.
    I worked two hours on the page header for page one.  When I started working on the page one header there were three pages in the document, each put there because I inserted a page break.  I also made sure that the document inspector had Hide First Page and Match Previous Section were NOT selected.
    Much to my surprise when I finished working on the header on page one, the same header was on page two.  I started to change the header on page two, but found it was changing the first page header.
    Going back and forth for a couple of hours I now have the page one header ok by itself.  Except . . . when I clicked in the page one header a pop up bubble appeared with the message: "Editing header for pages 1 - 2."
    The only thing I can think of is that the header I composed is fairly complex.  It has a mixture of fonts, sizes, and colors.  Outside of the header box I made a horizontal line, 1 pt. in size, with a grey color.  I moved the line into the area with the header box and the result is great.  Except that is not the header I want for page two.
    I would sincerely appreciate any suggestions based upon practical experience that has worked.  Please, you are kind, but no guesses.

  • Hyperlinks to other documents in Pages  ?

    Even in such a miserable tool as Ms word, it is possible (though unreliable) to set a hyperllink from a document so as to open a different document which is not a webpage, e.g. a pdf. As far as I can see this was not possible in the previous Pages. Does anyone know if this is possible with the new Pages ?

    Although Pages ’09 v4.3 allowed linking to other Pages documents, this feature is not implemented in Pages v5.2.2. This is a new application rewrite of Pages that Apple has omitted nearly 110 features/functionality found in Pages ’09. If you need to link to other documents, then Pages v5.2.2 is not the application of choice.

  • Can I convert PDF documents to Pages or other formats?

    Can a PDF Document be converted to pages or other format like RTF, Text, ETC.

    Have you tried the File ➙ Export To menu in Pages for some format options?

  • Linking other documents into Pages

    Hello. This is my first post and I'm a recent convert from a PC. I've scoured this forum for an answer and played for ages myself and not been able to sort out my problem - so I apologise in advance if its been answered a hundred times before!
    I am preparing a report in Pages and I would like to include links within in it to select other objects, such as pdf files, presentations etc. I don't want these open all the time, just if the reader wants to access the info. I see how you can put in a link to call out another Pages report, but not say a pdf file. I have tried dragging and dropping a pdf from Finder, but it opens it out and I just want a little icon that the reader can select.
    Any suggestions? Thanks. Katarine

    Hi Katarine
    Welcome to the forum.
    Pages lets you link to other Pages documents, but not particular pages within those documents, bookmarks within the same document, and weblinks.
    So the limitation will be yes you can link to .pdf files but they will need to be have an url and be on an accessible website.
    As Yvan said you can ask Apple to make this more flexible:
    +Menu > Pages > Provide Pages Feedback+
    Peter

  • Scanning multiple pages in one document

     I am trying to scan multiple pages in one document.  I am using a HP Envy 4501 All-in-one and running Windows 8.1.  I used to be able to do this at one point but for some reason, lately I am not able to.  I have read other posts that spoke of a "+" sign on the left side of the screen, but it is not there for me.  Also, I cannot just save the page and scan the next without having to save them under different file names.  Please advise.
    This question was solved.
    View Solution.

    Hi,
    From the HP Software click on Scan a Document or Photo and ensure the Sow Scan Preview is checked.
    Reduce the Scan Resolution into 300 or a lower resolution and press on Scan, then the add button should appear again.
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • Scanning multiple pages as one document

    When I was using Windows XP with my HP 3055 I could scan multiple pages as one document.  Since I have upgraded to Windows 7 Pro, when I scan, each page is scanned as a new document.  Also, I no longer have the option to scan the document as a pdf.   The pdf problem is not that important, but it is very important to be able to scan multiple pages as one document.  How can I make my HP scan all pages as one document?
    Thank you.

    Hi @flyrod40 ,
    I see that you would like to be able to scan multiple pages to one file. I would be happy to help you.
    What printer do you have? Deskjet 3050 or the Laserjet 3050.
    How Do I Find My Model Number or Product Number?
    If you are using the HP Scan Software, open the software, select the link for Advanced Settings, then click on the File tab and put a check mark in Create a separate file for each scanned page. This will allow you to scan multiple pages to one file.
    Here are the screen shots.
    Hope this helps.
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Scanning multiple pages into single document

    Is there a way to scan multiple pages into single document?  I am using the following: HP pavilion laptop with windows 8,  HP photosmart C6380 all in one printer scanner copier.

    Hi,
    Please try
    Double click printer icon on desktop,
    Select Scan a Document or Photo,
    Put the first page on the glass (face down),
    Check options (size, dpi ...), and select Scan document to file,
    Click Scan - machine will scan the first page
    Remove the first page on the glass, put the second page,
    Click + (plus sign) It sits on the left hand side of a red x
    Machine will scan the second page, put 3rd page on the glass and click + again ..... to the end then click Save
    Click Done after Save
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • I have been sent a 'word document' in which are a series of boxes about thirty lines long to insure written text. When Pages opens the document it extends these to a whole A4 page how do I get it to retain the original layout

    I have been sent a 'word document' in which are a series of boxes about thirty lines long to insert written text. When Pages opens the document it extends these to a whole A4 page how do I get it to retain the original layout

    You can't change the way Pages import .doc files.
    It was never written that it reproduce exactly the original one.
    From my point of view, as I refuse to give a cent to M...soft, the best way to deal with documents issued by their Office suite is to use the free libreOffice.
    Yvan KOENIG (VALLAURIS, France) jeudi 7 juillet 2011 11:34:19 iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How to setup a link that is of the type "Go to a page in another document"?

    Is there a direct way for a javascript to setup a link that is equivalent to the acrobat link type  you get when you add a link of the type “Go to a page in another document”?
    Tools-Advanced Editing-Link tool, make a box
    Check: Go to page view, Next (Create go to view dialog opens)
    Open second document and go to page
    Click “Create go to view dialog” to set up link
    Result is a link, when view by link properties, with an action of
    Go to a page in another document
    File: C:\My Documents\File2.pdf
    Page: 43
    Zoom level: Custom
    I have a java script in a setAction of a link that I think does the job:
    l.setAction("var otherDoc = app.openDoc('../Folder2/File2.pdf', this);otherDoc.pageNum = 1 - 1;");
    But is there a more direct way that actual sets up a “a link of the type Go to a page in another document” so if it's "advanced edited" its the same as the manual set links?
    I would like to setup a set of pdf documents, on the hard disk of a PC or Mac, that can be open with acrobat pro running on the same computer and have the link jump to, and open in a new window, in acrobat pro, to a given page of a second document in the set.
    John
    Code example in more detail:
    /* Insert document level JavaScript to set disclosed = true.
       This will run when the document is opened.*/
    this.addScript("setDisclosed", "this.disclosed = true;");
    // Search through the document for the word “Acrobat” and create a link around that word.
    for (var p = 0; p < this.numPages; p++)
        var numWords = this.getPageNumWords(p);
        for (var i=0; i<numWords; i++)
            var ckWord = this.getPageNthWord(p, i, true);
            if ( ckWord == "Acrobat")
                var q = this.getPageNthWordQuads(p, i);
                // Convert quads in default user space to rotated
                // User space used by Links.
                m = (new Matrix2D).fromRotated(this,p);
                mInv = m.invert()
                r = mInv.transform(q)
                r=r.toString()
                r = r.split(",");
                l = addLink(p, [r[4], r[5], r[2], r[3]]);
                l.borderColor = color.blue
                l.borderWidth = 1
                //l.setAction("this.getURL('http://www.adobe.com/');");
               l.setAction("var otherDoc = app.openDoc('../Folder2/File2.pdf', this);otherDoc.pageNum = 3 - 1;");
    Current Systems in use to create documents with links and view them:
    Windows XP SP3
    Word 2003 SP3
    Acrobat 9 pro version 9.4.4
    Or just to view them:
    Mac OS 10 Lion version 10.7.4
    Acrobat 9 pro version 9.5.1
    (note I have limited understanding of Mac’s)

    If you use buttons instead, it is possible to script adding the actions that you want. It involves creating a properly constructed FDF, saving it, and then importing it into the document. Buttons can be made to appear just like links. For more information, see: http://www.planetpdf.com/developer/article.asp?ContentID=6338

Maybe you are looking for

  • How do i use IPAD wifi when travelling

    I have been extensively using IPAD 2 . I recently decided to upgrade mine to IPAD3 . I bought one at the grove apple store and before that asked the salesman the difference in the IPAD 2 AND IPAD 3. He said the resolution of camera and picture was go

  • Email sub account locked out & won't unlock

    My "primary" email account already went through the verizonwireless annoyance now, one of my "sub" email accounts is locked due to excessive failed attempts. Ok, normally I can deal with that. However, when prompted to change password & security ques

  • [SOLVED]TeamViewer doesn't start with Wine

    Hello, I installed TeamViewer, the remote control program. I downloaded it here : http://www.teamviewer.com/download/index.aspx On Wine appdb page, TeamViewer seems to be supported : http://appdb.winehq.org/objectManager.p … n&iId=5956 I used default

  • I don't want to open certain tabs when starting FF

    I'm using a PC in a different environment and when I start FF 6.0 a couple of Tabs open that I no longer need. How do I stop FF from opening those Tabs? Thanks, John

  • Remove duplicates

    I down loaded a couple of songs from my CD to itunes.  Now downloaded the whole CD and it shows the songs I first added twice. How do I get it to replace or not download duplicates?