mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-07-15 15:23:20 +08:00
add changes from unsaved file
This commit is contained in:
parent
6e1cf89cf9
commit
e7f96c0b16
@ -30,7 +30,7 @@ namespace UglyToad.PdfPig.Writer
|
||||
private readonly Dictionary<Guid, FontStored> fonts = new Dictionary<Guid, FontStored>();
|
||||
private readonly Dictionary<Guid, ImageStored> images = new Dictionary<Guid, ImageStored>();
|
||||
private readonly Dictionary<IndirectReferenceToken, IToken> unwrittenTokens = new Dictionary<IndirectReferenceToken, IToken>();
|
||||
|
||||
private bool completed = false;
|
||||
internal int fontId = 0;
|
||||
|
||||
/// <summary>
|
||||
@ -444,7 +444,8 @@ namespace UglyToad.PdfPig.Writer
|
||||
}
|
||||
return dict;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CompleteDocument()
|
||||
{
|
||||
// write fonts to reserved object numbers
|
||||
@ -584,6 +585,8 @@ namespace UglyToad.PdfPig.Writer
|
||||
|
||||
context.CompletePdf(catalogRef, informationReference);
|
||||
|
||||
completed = true;
|
||||
|
||||
(int Count, IndirectReferenceToken Ref) CreatePageTree(List<Dictionary<NameToken, IToken>> pagesNodes, IndirectReferenceToken parent)
|
||||
{
|
||||
// TODO shorten page tree when there is a single or small number of pages left in a branch
|
||||
@ -807,6 +810,11 @@ namespace UglyToad.PdfPig.Writer
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
if (!completed)
|
||||
{
|
||||
CompleteDocument();
|
||||
}
|
||||
|
||||
context.Dispose();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user