PdfImporter.Import

Import(Stream, PdfImportOptions)

Importe le contenu d’un document PDF à partir d’un flux fourni.

public static List<Page> Import(Stream stream, PdfImportOptions options = null)
ParamètreTaperLa description
streamStreamLe flux.
optionsPdfImportOptionsLes options.

Return_Value

LePdfImporter .

Voir également


Import(string, PdfImportOptions)

Importe le contenu d’un document PDF à partir d’un fichier spécifié.

public static List<Page> Import(string file, PdfImportOptions options = null)
ParamètreTaperLa description
fileStringLe fichier PDF.
optionsPdfImportOptionsLes options.

Return_Value

LePdfImporter .

Exemples

Montre comment importer toutes les pages d’un document PDF regroupant toutes les 5 pages sur une seule page OneNote.

string dataDir = RunExamples.GetDataDir_Import();

var d = new Document();

var mergeOptions = new MergeOptions() { ImportAsSinglePage = true, PageSpacing = 100 };

IEnumerable<Page> pages = PdfImporter.Import(Path.Combine(dataDir, "SampleGrouping.pdf"));
while (pages.Any())
{
    d.Merge(pages.Take(5), mergeOptions);
    pages = pages.Skip(5);
}

d.Save(Path.Combine(dataDir, "sample_CustomMerge.one"));

Voir également