Crea PDF a più livelli in C#

Refer to this article to create PDF in layers in C#. It contains details on how to set up the IDE, a list of steps, and sample code that demonstrates how to create layers in Adobe Acrobat using C#. Some options for customizing the properties of the layers generated in the PDF will be discussed.

Passaggi per aggiungere livelli a PDF in C#

  1. Set up the environment to use Aspose.PDF for .NET to add PDF layers.
  2. Set the product license to access all features.
  3. Crea un nuovo PDF vuoto document
  4. Add a blank PDF page to the new document.
  5. Crea due layers nella pagina impostando nomi diversi
  6. Scrivi del testo di esempio sul primo livello
  7. Scrivi un altro testo sul secondo livello
  8. For each text, draw it first on the page and move that drawing to the destination layer.
  9. This text will be shown only when this level is visible.
  10. Save the output PDF file with layers.

Questi passaggi descrivono come creare livelli in PDF in C#. Create an empty PDF file, add a PDF page, create a layer with an ID and a name, and call a routine to add content to the layer. Crea un frammento di testo, disegnalo sulla pagina e sposta il disegno sul livello di destinazione in modo che il testo venga mostrato solo quando il livello è visibile.

Codice per creare i livelli Acrobat in C#

Questo codice dimostra come creare un PDF a più livelli in C#. It is possible to set distinct foreground/background colors for each layer, lock the layer to prevent accidental changes, and, if necessary, flatten any layer. If you want to export an individual layer as a separate PDF, call the save method in the Layer class so that not all layers are copied into the output PDF.

Questa breve guida spiega come creare un PDF a più livelli. To remove blank pages from a PDF, see the article Remove blank PDF pages using C#.

 Italiano