- Posts: 962
- Thank you received: 87
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Unexpected behavior when calling ImportPage()
IP: 192.168.0.158
11 years 9 months ago #7841
by nermeen
Replied by nermeen on topic Unexpected behavior when calling ImportPage()
Please check the new beta version
3.2beta3
it has a fix for the issue when import one Page many times in one context.
10 years 3 months ago #10758
by prouland
Replied by prouland on topic Unexpected behavior when calling ImportPage()
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 :
Is there a call missing or something ?
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 :
Code:
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 ?
10 years 3 months ago - 10 years 3 months ago #10759
by support
Replied by support on topic Unexpected behavior when calling ImportPage()
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.
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.
Last edit: 10 years 3 months ago by support.
10 years 3 months ago - 10 years 3 months ago #10761
by prouland
Replied by prouland on topic Unexpected behavior when calling ImportPage()
Thank you for all those information !
Is it possible to send you a file privately ?
Is it possible to send you a file privately ?
Last edit: 10 years 3 months ago by prouland.
10 years 3 months ago #10762
by support
Replied by support on topic Unexpected behavior when calling ImportPage()
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.
All the information are mandatory to enable us elaborate the ticket.
Time to create page: 0.364 seconds