Hi,
we used Skim to create annotation pdf documents with a digital pen. On Mac OS 10.12 Sierra Beta 2, the ink on those ink annotated documents does not appear on the page anymore. The ink does appear on the page preview, just not on the actual page. Please see attached pdf document.
Is this with the latest release? If so this means that 10.12 did not fix the Ink drawing bug in 10.11, and this really should be reported to Apple. I cannot do that, as I don't have access to Sierra.
It us weird that it does appear on the preview though, because in the end they shoud go through the same drawing routines.
In the end, this is really an Apple bug, they're the one who display the annotations in PDFKit.
10.11 works fine, starts happening on 10.12 beta. Preview is alos having the same problem.
Last edit: Benjamin 2016-07-27
Well, because on 10.11 we work around the bug. We should not always work around every issue, Apple needs to fix their bugs, because workarounds lead to their own problems (in particular here where the documentation is badly lacking). They had (and still have) ample time, and warning from multiple sources. Please, also file a bug report with them that Ink and Line annotations are shifted on the page on 10.11 and 10.12beta2, and don't display properly, the more reports they get the more urgent the problem becomes (and I would say as they are already in beta it becomes more urgent).
Could you please try the test version at http://skim-app.sourceforge.net/Skim.dmg to see of this fixes the problem?
Tried, It had the same problem.
This may not be connected but it seems that on 10.12 - (void)drawWithBox: is not getting called in some cases for the PDFView subclass. Its okay for the thumbnails but the main view doesn't get this call. Setting NSColor *backgroundColor = [NSColor redColor]; in SKPDFPage -drawWIthBox: highlights the issue. This was fine on 10.11.
Further digging reveasl that PDFView -drawPage: is not getting called at all for the main PDFView on Sierra. I have reported this as abug. I suggest you do the same.
Last edit: Jonathan Mitchell 2016-08-02
That would explain why our workarounds don't work. But it would also mean that 10.12 both has the same bugs, and moreover removes all possibilities to work around the bugs. Which means the bug is even more serious than on 10.12. Moreover, it would mean that in addition they now have a documentation bug to boot. This is outrageous, because they know about this bug for a very long time, and they should be very easy for them to fix. Please do report the issue to Apple, they really need to fix this bfore the GM. (Unfortunately given their history I have very little confidence in them at this point).
I am not sure what is going on here. There has been some tinkering according to the headers.
- (void) drawWithBox: (PDFDisplayBox) box PDFKIT_DEPRECATED(10_4, 10_12);- (void) drawWithBox: (PDFDisplayBox) box toContext:(CGContextRef)context PDFKIT_AVAILABLE(10_12);- (void) drawPage: (PDFPage *) page PDFKIT_DEPRECATED(10_4, 10_12);- (void) drawPage: (PDFPage *) page toContext:(CGContextRef)context PDFKIT_AVAILABLE(10_12);However the context aware methods don't get called either. Apple's preview app seems okay so we are missing out on something here.
This issue has apple bug id 27666426.
I logged this as a bug (27666426) and can see now that it is being flagged as an open duplicate (27668895). So hopefully we shall see some action on this.
Could any of you please test the (new) test version (at the same location).
If you create a branch for any sierra changes I can help validate them.
Can you test the current HEAD? I've moved the workaround to drawWithBox:inContext: instead.
I havent had time to build HEAD but in my own app I can see that
- (void)drawWithBox:(PDFDisplayBox)box toContext:(CGContextRef)contextis getting called for my subclass so it shoul be okay. The only other possible issue is that you have to use the passed in CGContextRef for any Cocoa drawing rather than defaulting, as I was, to[[NSGraphicsContext currentContext] graphicsPort].Yes, that's exactly what the crrent HEAD is doing.
Should be okay then. Note that the above refers to 10.12 Beta (16A294a) - AKA Beta 6. Earlier betas may not call
- (void)drawWithBox:(PDFDisplayBox)box toContext:(CGContextRef)context.I think drawWithBox: always calls drawWithBox:toContext: in every version. I know it was true in a much earlier OS version (10.5 IIRC) because the main PDFKit developer said so, it does seem to be true in 10.11, and as the former is even deprecated in 10.12 it must be true in 10.12.
There is also new method to intiliaze annotations:
But parameter description is not present in documentation.
https://developer.apple.com/reference/quartz/pdfannotation/1642241-initwithdictionary?language=objc
Let me know if you have any details.
Last edit: Parag Bafna 2016-09-07
Are you sure this is still present in the Sierra release?