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

TOPIC:

Unexpected behavior when calling ImportPage() 9 years 5 months ago #7841

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
Please check the new beta version 3.2beta3 it has a fix for the issue when import one Page many times in one context.

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

Unexpected behavior when calling ImportPage() 7 years 10 months ago #10758

  • prouland
  • prouland's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
Hello all,

I encounter a similar issue with the ImportPage() method.

I want to make a new PDF doc with some pages of others docs. So I create one document for each page I want to import. The issue comes here. The resulting one-page-doc has the same weight as the original doc. Which means that the merged doc is many larger that it has to be !

For example, I export 2 pages of a 4MB PDF, and merged thoses pages. The resulting PDF weight is 8MB .... Not usable at all !

The one-page creation routine I use is :
Document.ImportContext importContext = document.ImportStart(docToMerge);
if (importContext != null) {
    document.ImportPage(importContext, page, 0);
    importContext.Destroy();
}
boolean save = document.Save();
document.Close();
docToMerge.Close();

Is there a call missing or something ?

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

Unexpected behavior when calling ImportPage() 7 years 10 months ago #10759

  • support
  • support's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 692
  • Thank you received: 59
When moving a page from a pdf fo a new one, each resources referenced in the page are moved themselves: fonts, images, annotations, etc.
Importing a second page, even if resources are already imported in the first one, they are doubled: the reason is the import process isn't unaware about the page source and the embedding font mechanism consists of naming fonts' streams with a syntax like 12345+fontname where first characters are random.

When you generate a pdf from a source like Word or Indesign, each resource is added once by the pdf generator as it's aware about the referenced data.

If you would like we could check one of your file and see how they are structured.

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

Last edit: by support.

Unexpected behavior when calling ImportPage() 7 years 10 months ago #10761

  • prouland
  • prouland's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0
Thank you for all those information !

Is it possible to send you a file privately ?

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

Last edit: by prouland.

Unexpected behavior when calling ImportPage() 7 years 10 months ago #10762

  • support
  • support's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 692
  • Thank you received: 59
Open a ticket in the support area, provide the file, the link to this forum's thread and your order reference number.
All the information are mandatory to enable us elaborate the ticket.

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum