Rank: Guest
Groups: Guests
Joined: 1/5/2016(UTC) Posts: 162
Was thanked: 5 time(s) in 5 post(s)
|
Hello,
i'm testing th SDK and use the following code to duplicate 2 pages in the same PDF (MainPDFDoc) before the fist page (index 0)
MainPDFDoc.Pages.ImportPages(MainPDFDoc, "22,23", 0)
I see the memory consumption is rising very fast von 40 MBytes (after loading the 60 pages PDF) to 140 MBytes when running this function several times. f.e in a loop.
By the way:
Is there a simple way of moving pages (f.e. move page 10 after page 2) in the same PDF.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
Hi, I will transfer this issue to the developers. Thank you.
And no. API does not have other ways for page moving.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
Hi all, Currently I can suggest the following workaround. Code:
static void SimpleImport()
{
using (var dst = PdfDocument.Load(@"d:\0\1.pdf"))
{
var src = PdfDocument.Load(@"d:\0\100ThousandPages.pdf");
int cnt = src.Pages.Count;
for (int i = 0, j=0; i < cnt; i++, j++)
{
//Process sourcePage
var scrPage = src.Pages[i].Handle;
//Import page
dst.Pages.ImportPages(src, (i+1).ToString(), dst.Pages.Count - 1);
//DisposePage
src.Pages[i].Dispose();
if(j>20)
{
j = 0;
src.Dispose();
src = PdfDocument.Load(@"d:\0\100ThousandPages.pdf");
Console.WriteLine(i);
}
}
src.Dispose();
dst.Save(@"d:\0\imported.pdf", Patagames.Pdf.Enums.SaveFlags.NoIncremental);
}
}
Edited by user Monday, March 26, 2018 7:17:58 AM(UTC)
| Reason: Not specified
|
|
|
|
|
|
Forum Jump
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.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close