Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Drawing;
using Syncfusion.Drawing;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Interactive;

//Create a new document.
PdfDocument document = new PdfDocument();

//Add first page.
PdfPage page = document.Pages.Add();
//Create a new PDF document.
using (PdfDocument document = new PdfDocument())
{
//Add first page.
PdfPage page = document.Pages.Add();

//Add second page.
PdfPage secondPage = document.Pages.Add();
//Add second page.
PdfPage secondPage = document.Pages.Add();

//Set the goto action.
PdfGoToAction gotoAction = new PdfGoToAction(secondPage);
//Set the goto action.
PdfGoToAction gotoAction = new PdfGoToAction(secondPage);

//Set destination location.
gotoAction.Destination = new PdfDestination(secondPage, new PointF(0, 100));
//Set destination location.
gotoAction.Destination = new PdfDestination(secondPage, new PointF(0, 100));

//Add the action to the document.
document.Actions.AfterOpen = gotoAction;
//Add the action to the document.
document.Actions.AfterOpen = gotoAction;

//Create file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document to file stream.
document.Save(outputFileStream);
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
}

//Close the document.
document.Close(true);

Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Pdf;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Interactive;

//Create a new document.
PdfDocument document = new PdfDocument();

//Add a page.
PdfPage page = document.Pages.Add();
//Create a new PDF document.
using (PdfDocument document = new PdfDocument())
{
//Add a page.
PdfPage page = document.Pages.Add();

//Create JavaScript action.
PdfJavaScriptAction scriptAction = new PdfJavaScriptAction("app.alert(\"Hello World!!!\")");
//Create JavaScript action.
PdfJavaScriptAction scriptAction = new PdfJavaScriptAction("app.alert(\"Hello World!!!\")");

//Add the JavaScript action.
document.Actions.AfterOpen = scriptAction;
//Add the JavaScript action.
document.Actions.AfterOpen = scriptAction;

//Create file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document to file stream.
document.Save(outputFileStream);
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
}

//Close the document.
document.Close(true);

Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Pdf;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Interactive;

//Create a new document with PDF/A standard.
PdfDocument document = new PdfDocument();

//Create a uri action.
PdfUriAction uriAction = new PdfUriAction("http://www.google.com");

//Add the action to the document.
document.Actions.AfterOpen = uriAction;

//Create file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
//Create a new PDF document.
using (PdfDocument document = new PdfDocument())
{
//Save the PDF document to file stream.
document.Save(outputFileStream);
}
//Create a uri action.
PdfUriAction uriAction = new PdfUriAction("http://www.google.com");

//Add the action to the document.
document.Actions.AfterOpen = uriAction;

//Close the document.
document.Close(true);
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Pdf;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Interactive;

//Create a new PDF document.
PdfDocument document = new PdfDocument();

//Create and add new launch action to the document.
PdfLaunchAction action = new PdfLaunchAction(Path.GetFullPath(@"Data/logo.png"));
document.Actions.AfterOpen = action;

//Create file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
using (PdfDocument document = new PdfDocument())
{
//Save the PDF document to file stream.
document.Save(outputFileStream);
}
//Create and add new launch action to the document.
PdfLaunchAction action = new PdfLaunchAction(Path.GetFullPath(@"Data/logo.png"));
document.Actions.AfterOpen = action;

//Close the document.
document.Close(true);
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Pdf.Interactive;
using Syncfusion.Pdf.Interactive;
using Syncfusion.Pdf.Parsing;

//Get stream from the existing PDF document.
FileStream docStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read);

//Load the PDF document.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream);
using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument(Path.GetFullPath(@"Data/Input.pdf")))
{

//Create JavaScript action.
PdfJavaScriptAction scriptAction = new PdfJavaScriptAction("app.alert(\"Hello World!!!\")");
//Create JavaScript action.
PdfJavaScriptAction scriptAction = new PdfJavaScriptAction("app.alert(\"Hello World!!!\")");

//Add the JavaScript action.
loadedDocument.Actions.AfterOpen = scriptAction;
//Add the JavaScript action.
loadedDocument.Actions.AfterOpen = scriptAction;

//Create file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document to file stream.
loadedDocument.Save(outputFileStream);
//Save the PDF document
loadedDocument.Save(Path.GetFullPath(@"Output/Output.pdf"));
}

//Close the document.
loadedDocument.Close(true);
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Pdf;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Interactive;

//Create a new PDF document.
PdfDocument document = new PdfDocument();

//Create and add new launch Action to the document.
PdfLaunchAction action = new PdfLaunchAction(Path.GetFullPath(@"Data/logo.png"));
document.Actions.AfterOpen = action;

//Create file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
using (PdfDocument document = new PdfDocument())
{
//Save the PDF document to file stream.
document.Save(outputFileStream);
}
//Create and add new launch Action to the document.
PdfLaunchAction action = new PdfLaunchAction(Path.GetFullPath(@"Data/logo.png"));
document.Actions.AfterOpen = action;

//Close the document.
document.Close(true);
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Pdf;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Interactive;

//Create a new document.
PdfDocument document = new PdfDocument();

//Add pages to PDF document.
document.Pages.Add();
document.Pages.Add();
//Create a new PDF document.
using (PdfDocument document = new PdfDocument())
{
//Add pages to PDF document.
document.Pages.Add();
document.Pages.Add();

//Create a named action.
PdfNamedAction namedAction = new PdfNamedAction(PdfActionDestination.LastPage);
//Create a named action.
PdfNamedAction namedAction = new PdfNamedAction(PdfActionDestination.LastPage);

//Add the named action.
document.Actions.AfterOpen = namedAction;
//Add the named action.
document.Actions.AfterOpen = namedAction;

//Create file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document to file stream.
document.Save(outputFileStream);
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
}

//Close the document.
document.Close(true);

Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Drawing;
using Syncfusion.Drawing;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Interactive;

//Create a PDF document.
PdfDocument document = new PdfDocument();

//Add a new page.
PdfPage page = document.Pages.Add();

//Create a Button field.
PdfButtonField submitButton = new PdfButtonField(page, "Submit data");
//Create a new PDF document.
using (PdfDocument document = new PdfDocument())
{
//Add a new page.
PdfPage page = document.Pages.Add();

//Set the properties to the button field.
submitButton.Bounds = new RectangleF(100, 60, 50, 20);
submitButton.ToolTip = "Submit";
document.Form.Fields.Add(submitButton);
//Create a Button field.
PdfButtonField submitButton = new PdfButtonField(page, "Submit data");

// Create a submit action. It submit the data of the form fields to the mentioned URL.
PdfSubmitAction submitAction = new PdfSubmitAction("http://www.syncfusionforms.com/Submit.aspx");
submitAction.DataFormat = SubmitDataFormat.Html;
submitButton.Actions.GotFocus = submitAction;
//Set the properties to the button field.
submitButton.Bounds = new RectangleF(100, 60, 50, 20);
submitButton.ToolTip = "Submit";
document.Form.Fields.Add(submitButton);

//Create file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document to file stream.
document.Save(outputFileStream);
}
// Create a submit action. It submit the data of the form fields to the mentioned URL.
PdfSubmitAction submitAction = new PdfSubmitAction("http://www.syncfusionforms.com/Submit.aspx");
submitAction.DataFormat = SubmitDataFormat.Html;
submitButton.Actions.GotFocus = submitAction;

//Close the document.
document.Close(true);
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
}
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
// See https://aka.ms/new-console-template for more information

using Syncfusion.Pdf;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Interactive;

//Create a new document.
PdfDocument document = new PdfDocument();

//Add a page.
PdfPage page = document.Pages.Add();

//Get stream from the sound file.
FileStream fileStream = new FileStream(Path.GetFullPath(@"Data/Startup.wav"), FileMode.Open, FileAccess.Read);
//Create a new PDF document.
using (PdfDocument document = new PdfDocument())
{
//Add a page.
PdfPage page = document.Pages.Add();

//Create a sound action.
PdfSoundAction soundAction = new PdfSoundAction(fileStream);
soundAction.Sound.Bits = 16;
soundAction.Sound.Channels = PdfSoundChannels.Stereo;
soundAction.Sound.Encoding = PdfSoundEncoding.Signed;
soundAction.Volume = 0.9f;
//Get stream from the sound file.
FileStream fileStream = new FileStream(Path.GetFullPath(@"Data/Startup.wav"), FileMode.Open, FileAccess.Read);

//Set the sound action.
document.Actions.AfterOpen = soundAction;
//Create a sound action.
PdfSoundAction soundAction = new PdfSoundAction(fileStream);
soundAction.Sound.Bits = 16;
soundAction.Sound.Channels = PdfSoundChannels.Stereo;
soundAction.Sound.Encoding = PdfSoundEncoding.Signed;
soundAction.Volume = 0.9f;

//Create file stream.
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite))
{
//Save the PDF document to file stream.
document.Save(outputFileStream);
}
//Set the sound action.
document.Actions.AfterOpen = soundAction;

//Close the document.
document.Close(true);
//Save the PDF document
document.Save(Path.GetFullPath(@"Output/Output.pdf"));
}
Loading
Loading