Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to highlight in right positions when pdf page is resized and centered? #54

Open
ThanhBHKloon opened this issue Dec 31, 2012 · 0 comments

Comments

@ThanhBHKloon
Copy link

Hi, I do not draw the pdf page as-is, but I resize and center it so that it fits the screen. How can I re-calculate the position to display the highlights (the yellow areas)?

Basically, if I have an outer frame, an inner frame which lies on the outer, then when I change the outer frame, I can calculate the inner frame to fit in the new outer frame. But your selection.frame seems not to be be what I can use to calculate. (selection.frame depends on the graphic context...) I guess that when I read the code:
for (Selection *s in self.selections)
{
CGContextSaveGState(ctx);
CGContextConcatCTM(ctx, s.transform);
CGContextFillRect(ctx, s.frame);
CGContextRestoreGState(ctx);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant