Added ability to raster orphan docs
This commit is contained in:
@@ -50,7 +50,7 @@ namespace Swarmops.Backend.SocketServices
|
||||
case "ConvertPdfHires":
|
||||
try
|
||||
{
|
||||
PdfProcessor.Rerasterize(Document.FromIdentity((int)json["DocumentId"]), PdfProcessor.PdfProcessorOptions.HighQuality);
|
||||
PdfProcessor.Rerasterize(Document.FromIdentity(Int32.Parse((string) json["DocumentId"])), PdfProcessor.PdfProcessorOptions.HighQuality | PdfProcessor.PdfProcessorOptions.ForceOrphans);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,8 @@ namespace Swarmops.Utility.BotCode
|
||||
public enum PdfProcessorOptions
|
||||
{
|
||||
None = 0,
|
||||
HighQuality = 0x0001
|
||||
HighQuality = 0x0001,
|
||||
ForceOrphans = 0x0002
|
||||
};
|
||||
|
||||
public static void RerasterizeAll()
|
||||
@@ -125,7 +126,7 @@ namespace Swarmops.Utility.BotCode
|
||||
{
|
||||
throw new InvalidOperationException("Document is not rasterized");
|
||||
}
|
||||
if (document.ForeignId == 0)
|
||||
if (document.ForeignId == 0 && ((int) options & (int) PdfProcessorOptions.ForceOrphans) == 0)
|
||||
{
|
||||
throw new InvalidOperationException("Document is an orphan");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user