Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
FlattenAnnot |
Post Reply |
Author | |
CrazyTIm
Team Player Joined: 21 Aug 11 Location: Australia Status: Offline Points: 29 |
Post Options
Thanks(0)
Posted: 28 Aug 15 at 6:34AM |
Hi guys, we found some issues with FlattenAnnot... (v11.15)
Here is the pdf: Before: http://tinyurl.com/og3hffn When we loop over each annotation, only 4 out of 8 annotations are actually flattened (returns 1), the other 4 are not (returns 0), and as you can see, after flattening one of the annotations has jumbled text: After: http://tinyurl.com/p9r23hu (note: looks fine when rendered in Chrome, but in Adobe Reader you can see the jumbled text) The jumbled text is really causing a problem, need to prevent this. Code (VB.NET): Q.LoadFromFile(PathToPDF, "") Dim pc As Integer = Q.PageCount ' loop over pages For i = 1 To pc Dim ac As Integer = Q.AnnotationCount ' flatten each annotation on this page For a = 1 To ac Dim f = Q.FlattenAnnot(a, 0) Dim g = "" Next Next ' save Q.SaveToFile(PathToPDF) Edited by CrazyTIm - 15 Sep 15 at 5:04AM |
|
jpbro
Senior Member Joined: 29 Mar 11 Status: Offline Points: 77 |
Post Options
Thanks(1)
|
Try looping backwards, or with your current loop call Q.FlattenAnnot(1,
0) instead of (a, 0). I think when you flatten an annotation the count
changes, so you are only going to flatten half the annotations using
your current approach.
|
|
CrazyTIm
Team Player Joined: 21 Aug 11 Location: Australia Status: Offline Points: 29 |
Post Options
Thanks(0)
|
Ok that solves the problem of only half of them flattening! Thanks mate.
We still have the issue where the text is reversed (mirrored), any thoughts about this? Its not readable as the characters sometimes overlap each other and this is a real issue. Jason.
|
|
CrazyTIm
Team Player Joined: 21 Aug 11 Location: Australia Status: Offline Points: 29 |
Post Options
Thanks(0)
|
Ok folks, so there is this useful function called NormalizePage(), not sure if anyone has heard about it :P
Turns out calling this before flattening annotations will prevent the text from being mirrored. I don't know if it works in all cases, but for now this seems to be working for a few different pdfs I've tested with. Cheers, Jason.
|
|
CrazyTIm
Team Player Joined: 21 Aug 11 Location: Australia Status: Offline Points: 29 |
Post Options
Thanks(0)
|
Hi all,
I have found a different pdf where calling NormalizePage() before flattening annotations results in no annotations at all. This is frustrating, because the solution to the first issue raised a second issue :) Can someone help me understand why calling NormalizePage() and then flatten doesn't work on this pdf. How I can solve this new problem? pdf #2 before flattening: http://tinyurl.com/nu6gw42 pdf #2 after flattening (no annotations!): http://tinyurl.com/qhwd2g7 Thanks, Jason Edited by CrazyTIm - 15 Sep 15 at 5:29AM |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store