mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-06-28 15:30:17 +08:00

* Enable nullable annotations * Remove unused Jetbrain annotations * Ensure system using statements are first * Improve nullability annotations * Annotate encryptionDictionary is non-null when IsEncrypted is true * Disable nullable for PdfTokenScanner.Get * Improve nullability annotations for ObjectLocationProvider.TryGetCached * Revert changes to RGBWorkingSpace * Update UglyToad.PdfPig.Package with new framework targets (fixes nightly builds)
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
namespace UglyToad.PdfPig.CrossReference
|
|
{
|
|
using System.Collections.Generic;
|
|
using Core;
|
|
using Tokens;
|
|
|
|
internal class CrossReferenceTablePartBuilder
|
|
{
|
|
private readonly Dictionary<IndirectReference, long> objects = new Dictionary<IndirectReference, long>();
|
|
|
|
public long Offset { get; set; }
|
|
|
|
public long Previous { get; set; }
|
|
|
|
public DictionaryToken? Dictionary { get; set; }
|
|
|
|
public CrossReferenceType XRefType { get; set; }
|
|
|
|
public long? TiedToPreviousAtOffset { get; set; }
|
|
|
|
public void Add(long objectId, int generationNumber, long offset)
|
|
{
|
|
IndirectReference objKey = new IndirectReference(objectId, generationNumber);
|
|
|
|
if (!objects.ContainsKey(objKey))
|
|
{
|
|
objects[objKey] = offset;
|
|
}
|
|
}
|
|
|
|
public CrossReferenceTablePart Build()
|
|
{
|
|
return new CrossReferenceTablePart(objects, Offset, Previous, Dictionary!, XRefType, TiedToPreviousAtOffset);
|
|
}
|
|
}
|
|
} |