Please try to understand each other. Adam's last E-mail is quite useful and perhaps may cut through this Gordian discussion knot ;-)
If I may try to sum up as clearly as possible: Page orientation is only stored in the individual page objects, all different instantiations (I hope I got this right). When you do a "refresh", all these objects are discarded and the information is lost (unless you would first save it). When the new pdf comes in, new objects (instantiations) of all the pages are created and they have no idea what the previous additional changes were the user might have made. No way to do something about it, the convenient it may look given the workflow. And Thomas as well as tcb, you need to revise your user model of Skim, that it would store somewhere those states (information) you are interested in. In a nutshell you need first to retrieve the current rotation state from all the pages and save that information somewhere. Do the refresh and then apply to each page that rotation state. An AppleScript seems to be the easiest solution, since Skim (as well as BibDesk) are so good, robust, and correctly functional applications because they do not implement all the whistles and bells the diverse user would like to have. Sometimes giving up on nice to have is tough, but remember the perfect is only too often the enemy of the good. My advice: Thomas, write the AppleScript, perhaps make it available to other users, and all will be happy. ;-) Regards, Andreas ETH Zurich Prof. Dr. Andreas Fischlin Systems Ecology - Institute of Integrative Biology CHN E 21.1 Universitaetstrasse 16 8092 Zurich SWITZERLAND [email protected] www.sysecol.ethz.ch +41 44 633-6090 phone +41 44 633-1136 fax +41 79 221-4657 mobile Make it as simple as possible, but distrust it! ________________________________________________________________________ On 07/Jan/2011, at 08:00 , Adam R. Maxwell wrote: > On Jan 6, 2011, at 22:13 , Thomas Schneider wrote: > >> Skim clearly holds a single parameter defining the display orientation >> of ALL pages for the entire document. It is NOT, I repeat, NOT the >> rotation of individual pages independently. > > Your repetition of this reminds me of a favorite quote [1]. I just looked at > the code, and you are clearly wrong, as Christiaan has said; I even ran this > with gdb to make sure I had the right method :). Obj-C is fairly readable, > so it should be obvious that rotating all pages by 90˚ sends the setRotation: > message to /each/ page of the document, and rotation is a property of the > PDFPage object. > > Since AppleScript exposes a rotation property for pages, presumably you can > set this yourself from a script, as I suggested previously. Alternately, you > could hack Skim to get each page's rotation and apply it to the new document > when you reload, or store a flag somewhere indicating that you had previously > rotated pages. However, what you want is obviously wrong for the general > case; when you create a new document, you get a new PDFDocument object with > all new PDFPage objects, which may or may not have a preexisting rotation. > > - (void)rotateAllBy:(NSInteger)rotation { > NSUndoManager *undoManager = [[self document] undoManager]; > [[undoManager prepareWithInvocationTarget:self] rotateAllBy:-rotation]; > [undoManager setActionName:NSLocalizedString(@"Rotate", @"Undo action > name")]; > [[self document] undoableActionDoesntDirtyDocument]; > > PDFPage *page = [pdfView currentPage]; > NSInteger i, count = [[pdfView document] pageCount]; > for (i = 0; i < count; i++) > [[[pdfView document] pageAtIndex:i] setRotation:[[[pdfView document] > pageAtIndex:i] rotation] + rotation]; > [pdfView layoutDocumentView]; > // due to as PDFKit bug, PDFView doesn't notice that it's currentPage has > changed, so we need to force a page change to have it notice first > [pdfView goToPreviousPage:nil]; > [pdfView goToPage:page]; > > [[NSNotificationCenter defaultCenter] > postNotificationName:SKPDFPageBoundsDidChangeNotification > object:[pdfView document] userInfo:[NSDictionary > dictionaryWithObjectsAndKeys:SKPDFPageActionRotate, SKPDFPageActionKey, nil]]; > } > > - (IBAction)rotateAllRight:(id)sender { > [self rotateAllBy:90]; > } > > [1] "Hypothesis, my dear young friend, establishes itself by a cumulative > process: or, to use popular language, if you make the same guess often enough > it ceases to be a guess and becomes a Scientific Fact." Mr. Enlightenment, > in "The Pilgrim's Regress" > > > ------------------------------------------------------------------------------ > Gaining the trust of online customers is vital for the success of any company > that requires sensitive data to be transmitted over the Web. Learn how to > best implement a security strategy that keeps consumers' information secure > and instills the confidence they need to proceed with transactions. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Skim-app-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/skim-app-users ------------------------------------------------------------------------------ Gaining the trust of online customers is vital for the success of any company that requires sensitive data to be transmitted over the Web. Learn how to best implement a security strategy that keeps consumers' information secure and instills the confidence they need to proceed with transactions. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Skim-app-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/skim-app-users
