Skip to content

921492 Updated output documents in interactive sample project #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,31 @@ Step 3: **Add required namespaces**: Include the following namespaces in your `P
Step 4: **Implement PDF compression**: Use the following code snippet in `Program.cs` to compress PDF files:

```csharp
// Open a file stream to read the input PDF file
// Open a file stream to read the input PDF file
using (FileStream fileStream = new FileStream("Input.pdf", FileMode.Open, FileAccess.Read))
{
// Load the PDF document from the file stream
using (PdfLoadedDocument loadedDocument = new PdfLoadedDocument(fileStream))
{
// Create a new PdfCompressionOptions object
PdfCompressionOptions options = new PdfCompressionOptions();

// Enable image compression and set the image quality
options.CompressImages = true;
options.ImageQuality = 50;

// Enable font optimization
options.OptimizeFont = true;

// Enable page content optimization
options.OptimizePageContents = true;

// Remove metadata from the PDF
options.RemoveMetadata = true;

// Compress the PDF document
loadedDocument.Compress(options);

// Save the document into a memory stream
using (MemoryStream outputStream = new MemoryStream())
{
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
PdfSignature signature = new PdfSignature(loadedDocument, page, pdfCert, "Signature");

// Set signature information
signature.Bounds = new RectangleF(new PointF(0, 0), new SizeF(200, 100));
signature.Bounds = new RectangleF(227.6355f, 675.795044f, 150.57901f, 32.58f);
signature.ContactInfo = "[email protected]";
signature.LocationInfo = "Honolulu, Hawaii";
signature.Reason = "I am the author of this document.";
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading