Пример #1
0
 private void DeletePremisFiles(List <DateiDIP> premisFiles)
 {
     foreach (var file in premisFiles)
     {
         var path     = GetPath(file.Id, paketToConvert.Inhaltsverzeichnis.Ordner, rootFolder);
         var fileName = Path.Combine(path, file.Name);
         if (File.Exists(fileName))
         {
             MetadataXmlUpdater.RemoveFile(new FileInfo(fileName), paketToConvert, rootFolder);
             File.Delete(fileName);
         }
     }
 }
Пример #2
0
        private void CreatePdfFile(List <FileInfo> imageFileList, string pdfFileName)
        {
            var pdfDocument = new Document();
            var parents     = new DateiParents();

            foreach (var imageFile in imageFileList)
            {
                AddPage(pdfDocument, imageFile.FullName);
                pdfDocument.FreeMemory();

                parents = MetadataXmlUpdater.RemoveFile(imageFile, paketToConvert, rootFolder);
                imageFile.Delete();
            }

            // Optimize
            pdfDocument.OptimizeResources(new Document.OptimizationOptions()
            {
                CompressImages = true,
                ImageQuality   = settings.JpegQualitaetInProzent,
                ResizeImages   = true
            });
            pdfDocument.Save(pdfFileName);
            MetadataXmlUpdater.AddFile(new FileInfo(pdfFileName), parents);
        }