Is there any API to allow me to embed audio files in the PDF?
Hi Alice,
Thanks for your inquiry. You can embed a file into PDF document using Aspose.Pdf. Please check following documentation link for the purpose, a sample output file PDF file is also enclosed.
Please feel free to contact us for any further assistance.
Best Regards,
Hi Alice,
Adding more to Tilal’s comments, you can also add a sound clip to a PDF file as an annotation object. Please take a look at the following code snippet.
[C#]
//open document
Document pdfDocument = new Document();
pdfDocument.Pages.Add();
//create annotation
Aspose.Pdf.InteractiveFeatures.Annotations.SoundAnnotation sound = new
Aspose.Pdf.InteractiveFeatures.Annotations.SoundAnnotation(
pdfDocument.Pages[1],
new Aspose.Pdf.Rectangle(200, 400, 400, 600),
"c:/pdftest/background.wav"
);
sound.Title = "Sound clip";
sound.Icon = SoundIcon.Speaker;
//add annotation in the annotations collection of the page
pdfDocument.Pages[1].Annotations.Add(sound);
//save output file
pdfDocument.Save("c:/pdftest/SoundClipAdded.pdf");