Added ability to raster orphan docs

This commit is contained in:
Rick Falkvinge
2017-10-01 19:36:42 +02:00
parent dea8f0419d
commit 5c793ee403
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -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)
{
+3 -2
View File
@@ -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");
}