Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF
  • Page:
  • 1

TOPIC:

Text field shifts after flattening 5 years 8 months ago #14051

  • jhaskins
  • jhaskins's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0



I have an issue that is only happening on some PDF files. The fields that are shifting have the comb property applied to them. However, not all fields with that property display incorrectly. Also, the issue only appears after I flatten the PDF:
//flatten pdf
        
            // create and load the document.
            PDFDoc *pdfDocument = [[PDFDoc alloc] init];
            PDF_ERR err = [pdfDocument open:[destinationPath stringByAppendingPathComponent:fileName] :nil];
            
            // create the cache.
            NSString *cacheName = [[NSTemporaryDirectory() stringByAppendingString:@""] stringByAppendingString:@"cache.dat"];
            [pdfDocument setCache:cacheName];
            
            // get the page count.
            int pageCount = [pdfDocument pageCount];
            
            // loop through the pages.
            for (int pageIndex = 0; pageIndex < pageCount; pageIndex++)
            {
                // get the page and prepare it.
                PDFPage *page = [pdfDocument page:pageIndex];
                [page flatAnnots];
            }
            
            [pdfDocument save];

Using 3.8.1
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by jhaskins.

Text field shifts after flattening 5 years 8 months ago #14052

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,

first of all you can try to update your project with the latest lib version (now is 3.8.5).
You can also share your pdf file and we'll check it

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum