From 30a3364ffa1067823b930b3e12d2e5e185c1a921 Mon Sep 17 00:00:00 2001 From: SF4524LogeshKumar Date: Tue, 1 Apr 2025 10:42:35 +0530 Subject: [PATCH 1/2] 931474: Fit To Width Sample --- How to/FitToWidth/ConsoleApp1.sln | 22 ++++++++++++++ .../FitToWidth/ConsoleApp1/ConsoleApp1.csproj | 14 +++++++++ How to/FitToWidth/ConsoleApp1/Output.pdf | Bin 0 -> 1463 bytes How to/FitToWidth/ConsoleApp1/Program.cs | 28 ++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 How to/FitToWidth/ConsoleApp1.sln create mode 100644 How to/FitToWidth/ConsoleApp1/ConsoleApp1.csproj create mode 100644 How to/FitToWidth/ConsoleApp1/Output.pdf create mode 100644 How to/FitToWidth/ConsoleApp1/Program.cs diff --git a/How to/FitToWidth/ConsoleApp1.sln b/How to/FitToWidth/ConsoleApp1.sln new file mode 100644 index 0000000..4e442b6 --- /dev/null +++ b/How to/FitToWidth/ConsoleApp1.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35527.113 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{974A1524-7916-4A6D-A66D-C71F56A751F8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {974A1524-7916-4A6D-A66D-C71F56A751F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {974A1524-7916-4A6D-A66D-C71F56A751F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {974A1524-7916-4A6D-A66D-C71F56A751F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {974A1524-7916-4A6D-A66D-C71F56A751F8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/How to/FitToWidth/ConsoleApp1/ConsoleApp1.csproj b/How to/FitToWidth/ConsoleApp1/ConsoleApp1.csproj new file mode 100644 index 0000000..251cbfc --- /dev/null +++ b/How to/FitToWidth/ConsoleApp1/ConsoleApp1.csproj @@ -0,0 +1,14 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + diff --git a/How to/FitToWidth/ConsoleApp1/Output.pdf b/How to/FitToWidth/ConsoleApp1/Output.pdf new file mode 100644 index 0000000000000000000000000000000000000000..621a85da654f271d87441ef5ad68af17813ef757 GIT binary patch literal 1463 zcmY!laBmM(dp@M-zeo_`MmyHcCmwrfPL8^kjb7DziPJTL&ACQ=y zTC89MR1*Z`g=MCerxpbirKY78rRF6AWsIRRAay>8mHDM53i`pBdFeT+AQ7Mz$K;}X zxBQ}91rvx$J3C&k)Vvh1jfMs&cDrTfl%y6Z=)2`4mZZ9*Cg-Ps4Dd6zjAy5~2~s+|wp{_R2U->;9^u6_T%C9U7+z=y8dc@L*u3yX}4e6(b3 z#}r<5ujJL%m#yNgB15Eh%#k(IJO4rQbI!{%nYN3RlD&UE-z)iale>#!q#~o4#k1+9 zTPjZR_1Wb*I(EhJ7HlYdf0*Oo!M`R_-?x<5=kGuKpfsegNkH+|J>^*)^2^t@Ci5io z^Oybl_0#^It2b-D-@UpPO&iyM-FF}KdSy5z_C7tl=40+>@rOMf^#Yfk%IulCMeyou z&utYw*XLdTGsD|oQ7cOPQLnn1){7+qhkD*GV7q_z$BWZ4<=!3l0<*KDl)N;5Smv%? zWL$c1r}C|`E{|o|mx_WX`%OES5xDJ))eFO-Eor9dq0G;lV)j*ijNY>T>Bq(eLUB{K zxCJd)n0wja*m|$m*-OsPCIV9fpbpeTkQ)@3Kifc{&i#@7oy%Kn8w@3wgD+`zUMsydV^K=*(vVt%V_S4s z+;6Cyt^1oZOXuY+c7ywc_kZr*t>1E>RO!Hs9ej*F8(tr2$b4cYa>$@?E{liE4nHmv zV~u7Nuh?{xBH1sWH;6Vod*i6lyzlDLrri=u5qG35CfBY$7~;&mFy(&X!UU6DyNYCm zPq{{JURl#*ZO?JQu2Af@vg$%hoq9#n%ZIwEpYfQ-UH`Q$&wD5P-LH@K$1mE*^e*1z zyw*J-Z~vs{YlPMGxBOuJf5s~P==sQuOWT5GYn@zqDs?eiUEQVlY0kpTJzn!%B*Nnq zy`D{6;IW72^AT;&n2$<5n;k+X#A!KPzZ7FWq1(xzapeasr4{ZTUAAEo5mRhd7sO2L z5StJ?sb4j1S&Lw9%A*G>K8IF2E3@hTcH(b*U%Go6@1azo>sxbj#TLYOuYY!U&%?iq zuSI_qT==){{c7jatK(*x%s}o4aL|9jo8e|4bdRceh|qZJ?qGQJe+k=a(pe5+JDb^2|#~tx$+I zP%t!(1#*Kkt5ShXcoK{VN=*ZD!WE(ofd!r+ND1D=Xkvz*7I_aJ6l4$(U^#fR_}pRd z6`v+74!E%{>p`chL1AUZ=P&P`I?ISiKYhyVBh6fm)%Bp#EwQMi0$9KT3uYq|b6_d0 K>gw;t%LM?CFlQP7 literal 0 HcmV?d00001 diff --git a/How to/FitToWidth/ConsoleApp1/Program.cs b/How to/FitToWidth/ConsoleApp1/Program.cs new file mode 100644 index 0000000..b18bff6 --- /dev/null +++ b/How to/FitToWidth/ConsoleApp1/Program.cs @@ -0,0 +1,28 @@ +using Syncfusion.Pdf; +using Syncfusion.Pdf.Graphics; +using System.IO; + +class Program +{ + static void Main() + { + // Create a new PDF document + PdfDocument doc = new PdfDocument(); + + // Add a new page to the document + PdfPage page = doc.Pages.Add(); + + // Set the document’s viewer preferences + doc.ViewerPreferences.FitWindow = true; // Fit the document to the window + doc.ViewerPreferences.PageLayout = PdfPageLayout.SinglePage; // Display one page at a time + + // Save and close the document + using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) + { + doc.Save(outputFileStream); // Save the document to a file + } + + // Close the document after saving + doc.Close(true); + } +} From 6d2126db2d5a9eea52e45249e69ac345236ef085 Mon Sep 17 00:00:00 2001 From: SF4524LogeshKumar Date: Tue, 1 Apr 2025 12:11:51 +0530 Subject: [PATCH 2/2] 931474: Updated changes Fit To Width Sample --- How to/FitToWidth/ConsoleApp1/ConsoleApp1.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/How to/FitToWidth/ConsoleApp1/ConsoleApp1.csproj b/How to/FitToWidth/ConsoleApp1/ConsoleApp1.csproj index 251cbfc..c9b500b 100644 --- a/How to/FitToWidth/ConsoleApp1/ConsoleApp1.csproj +++ b/How to/FitToWidth/ConsoleApp1/ConsoleApp1.csproj @@ -8,7 +8,7 @@ - +