This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Document ConvertFromImage(string filePath) | |
{ | |
var docStream = new MemoryStream(); | |
var doc = new Document(); | |
var page = doc.Pages.Add(); | |
var image = new Aspose.Pdf.Image | |
{ | |
ImageStream = new FileStream(filePath, FileMode.Open, FileAccess.Read) | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// POST: /api/merge | |
[HttpPost] | |
public IActionResult PostMergeFiles(IEnumerable<string> list) | |
{ | |
var document = new Document(); | |
foreach (var item in list) | |
{ | |
var filePath = Path.Combine(_storageRootFolder, item); | |
var pdfDocument = Path.GetExtension(item) switch | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Pdf; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Logging; | |
using System; | |
using System.Collections.Generic; | |
using System.Drawing; | |
using System.IO; | |
namespace Aspose.Demo.Pdf.Merger.Controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let lastIndex = 0; | |
function selectFileClickHandler() { | |
let order = parseInt($(this).attr('data-order')); | |
if (order > 0) { | |
$(this).attr('data-order', '0'); | |
$(this).find('span').hide('slow'); | |
for (let cell of $("*[data-order]")) { | |
let currentOrder = parseInt(cell.dataset.order); | |
if (currentOrder > order) { | |
cell.dataset.order = currentOrder - 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Mvc; | |
using System; | |
using System.Linq; | |
namespace Aspose.Demo.Pdf.Merger.Controllers | |
{ | |
[Route("api/[controller]")] | |
[ApiController] | |
public class TokenController : ControllerBase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Logging; | |
using System.IO; | |
using Microsoft.Extensions.Configuration; | |
namespace Aspose.Demo.Pdf.Merger.Controllers | |
{ | |
[Route("api/[controller]")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Demo.Pdf.Merger.Models; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Logging; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using Microsoft.Extensions.Configuration; | |
namespace Aspose.Demo.Pdf.Merger.Controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void ConvertPDFtoPPTX(string inputFileName, string outputFileName) | |
{ | |
var document = new Aspose.Pdf.Document(inputFileName); | |
foreach (var page in document.Pages) | |
{ | |
RemoveAnnotations(page, Pdf.Annotations.AnnotationType.Ink); | |
RemoveAnnotations(page, Pdf.Annotations.AnnotationType.Square); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void RemoveAnnotations(Page page, Aspose.Pdf.Annotations.AnnotationType annotationType) | |
{ | |
var annotations = page.Annotations.Where(a => a.AnnotationType == annotationType).ToArray(); | |
foreach (var annotation in annotations) | |
{ | |
page.Annotations.Delete(annotation); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void ShowAnnotations() | |
{ | |
var inputFileName = @"C:\tmp\Presentations\Sample Screen.pdf"; | |
var document = new Aspose.Pdf.Document(inputFileName); | |
foreach (var page in document.Pages) | |
{ | |
foreach (var annotation in page.Annotations) | |
{ | |
Console.WriteLine($"{page.Number} {annotation.FullName} {annotation.AnnotationType} {annotation.Color}"); | |
} |
NewerOlder