You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Library/NET/Working-with-HyperLinks.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,9 @@ documentation: UG
9
9
10
10
In PDF, hyperlinks can be added to allow the users to navigate to another part of PDF file, web page or any other external content. Essential<sup>®</sup> PDF provides support for all these types of hyperlink.
11
11
12
+
To quickly get started with working with hyperlinks in PDF documents using the Syncfusion<sup>®</sup> PDF library for .NET, refer to this video tutorial:
You can navigate to specified URL from a PDF document by using the [PdfTextWebLink](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Interactive.PdfTextWebLink.html) class.
Copy file name to clipboardExpand all lines: Document-Processing/PDF/PDF-Library/NET/Working-with-Images.md
+130Lines changed: 130 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -618,6 +618,136 @@ doc.Close(True)
618
618
619
619
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/Images/Paginate-an-image-in-PDF-document).
620
620
621
+
## Clipping and graphics state
622
+
623
+
This example demonstrates how to draw an image in a PDF document and apply a clipping region using the [SetClip](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Graphics.PdfGraphics.html#methods) method. Clipping restricts drawing to a defined area, allowing partial rendering of content. The code also uses [Save](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Graphics.PdfGraphics.html#methods) and [Restore](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Graphics.PdfGraphics.html#methods) methods of [PdfGraphics](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Graphics.PdfGraphics.html) to manage the graphics state, enabling temporary clipping and restoring the full drawing area afterward.
Using imageStream As New FileStream(Path.GetFullPath("Input.png"), FileMode.Open, FileAccess.Read)
721
+
' Load the image from the stream
722
+
Dim image As New PdfBitmap(imageStream)
723
+
724
+
' Save the current graphics state (to restore later)
725
+
Dim state As PdfGraphicsState = graphics.Save()
726
+
727
+
' Define a rectangular clipping region
728
+
Dim clipRect As New RectangleF(50, 50, 200, 100)
729
+
graphics.SetClip(clipRect)
730
+
731
+
' Draw the image — only the part within the clipping region will be visible
732
+
graphics.DrawImage(image, New RectangleF(40, 60, 150, 80))
733
+
734
+
' Restore the graphics state to remove the clipping region
735
+
graphics.Restore(state)
736
+
737
+
' Draw the image again — this time the full image will be visible
738
+
graphics.DrawImage(image, New RectangleF(60, 160, 150, 80))
739
+
End Using
740
+
741
+
' Save the PDF document
742
+
document.Save("Output.pdf")
743
+
End Using
744
+
745
+
{% endhighlight %}
746
+
747
+
{% endtabs %}
748
+
749
+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/Images/Clipping-and-graphics-state/.NET).
750
+
621
751
## Applying transparency and rotation to the image
622
752
623
753
You can add transparency and rotation to the image using [SetTransparency](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Graphics.PdfGraphics.html#Syncfusion_Pdf_Graphics_PdfGraphics_SetTransparency_System_Single_) and [RotateTransform](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Graphics.PdfGraphics.html#Syncfusion_Pdf_Graphics_PdfGraphics_RotateTransform_System_Single_) methods of [PdfGraphics](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Graphics.PdfGraphics.html) respectively. This is explained in the below code snippet.
0 commit comments