Skip to content

Commit 3c6ec7c

Browse files
881424: Added HTML to PDF performance benchmark in UG.
1 parent 1d992fb commit 3c6ec7c

File tree

1 file changed

+64
-62
lines changed

1 file changed

+64
-62
lines changed

File-Formats/PDF/Convert-HTML-To-PDF/troubleshooting.md

Lines changed: 64 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -853,9 +853,68 @@ Blink binaries (Version 109.0.5414.75),
853853

854854
</table>
855855

856+
857+
858+
## There was an error opening this document. This file is already open or in use by another application.
859+
860+
<table>
861+
<th style="font-size:14px" width="100px">Issue</th>
862+
<th style="font-size:14px">There was an error opening this document. This file is already open or in use by another application.
863+
</th>
864+
<tr>
865+
<th style="font-size:14px" width="100px">Reason
866+
</th>
867+
<td>The reported issue occurs due to the document or file not being properly disposed or closed, leading to conflicts when attempting to access it again.
868+
</td>
869+
</tr>
870+
<tr>
871+
<th style="font-size:14px" width="100px">Solution</th>
872+
<td>
873+
874+
We can resolve the reported issue by using the FileStream within the "using" block.
875+
{% tabs %}
876+
{% highlight C# %}
877+
878+
using (FileStream fs = new FileStream("path_to_file", FileMode.Open))
879+
{
880+
// Use the file here
881+
} // File stream is automatically closed and disposed
882+
883+
{% endhighlight %}
884+
{% endtabs %}
885+
886+
Or
887+
888+
Dispose of the FileStream at the end of the process and ensure that the file or document is not already open in another application.
889+
{% tabs %}
890+
{% highlight C# %}
891+
892+
893+
PdfDocument document = htmlConverter.Convert(");
894+
895+
FileStream fileStream = new FileStream(baseUrl+ "Bill_PDF_04_16_24.pdf", FileMode.CreateNew, FileAccess.ReadWrite);
896+
897+
//Save and close the PDF document.
898+
899+
document.Save(fileStream);
900+
901+
document.Close(true);
902+
903+
document.Dispose();
904+
905+
fileStream.Dispose();
906+
907+
{% endhighlight %}
908+
{% endtabs %}
909+
</td>
910+
</tr>
911+
912+
</table>
913+
914+
856915
## HTML to PDF Performance Benchmarks:
857916

858-
### Environment Details:
917+
<h2>Environment Details:</h2>
859918

860919

861920

@@ -871,7 +930,7 @@ System type : 64-bit operating system, x64-based processor
871930

872931

873932

874-
### Sample Details:
933+
<h2>Sample Details:</h2>
875934

876935

877936

@@ -888,7 +947,7 @@ Output Files : <a href="https://www.syncfusion.com/downloads/support/dire
888947
Input Files : <a href="https://www.syncfusion.com/downloads/support/directtrac/general/ze/Input1125518413">https://www.syncfusion.com/downloads/support/directtrac/general/ze/Input1125518413</a>
889948

890949

891-
### Results:
950+
<h2>Results:</h2>
892951

893952
<table border="1">
894953
<th style="font-size:14px" width="100px">Input Page count</th>
@@ -938,66 +997,9 @@ CPU usage: 64%</td>
938997
</tr>
939998
</table>
940999

941-
Note: The performance benchmark will vary depending on the following factors,
942-
1000+
N> The performance benchmark will vary depending on the following factors,
9431001
<ol>
9441002
<li>External resources loaded in the HTML (Such as Images, Scripts, and Styles)</li>
9451003
<li>Network speed for online URL conversions.</li>
9461004
<li>Hardware resources (CPU and Memory)</li>
947-
</ol>
948-
949-
## There was an error opening this document. This file is already open or in use by another application.
950-
951-
<table>
952-
<th style="font-size:14px" width="100px">Issue</th>
953-
<th style="font-size:14px">There was an error opening this document. This file is already open or in use by another application.
954-
</th>
955-
<tr>
956-
<th style="font-size:14px" width="100px">Reason
957-
</th>
958-
<td>The reported issue occurs due to the document or file not being properly disposed or closed, leading to conflicts when attempting to access it again.
959-
</td>
960-
</tr>
961-
<tr>
962-
<th style="font-size:14px" width="100px">Solution</th>
963-
<td>
964-
965-
We can resolve the reported issue by using the FileStream within the "using" block.
966-
{% tabs %}
967-
{% highlight C# %}
968-
969-
using (FileStream fs = new FileStream("path_to_file", FileMode.Open))
970-
{
971-
// Use the file here
972-
} // File stream is automatically closed and disposed
973-
974-
{% endhighlight %}
975-
{% endtabs %}
976-
977-
Or
978-
979-
Dispose of the FileStream at the end of the process and ensure that the file or document is not already open in another application.
980-
{% tabs %}
981-
{% highlight C# %}
982-
983-
984-
PdfDocument document = htmlConverter.Convert(");
985-
986-
FileStream fileStream = new FileStream(baseUrl+ "Bill_PDF_04_16_24.pdf", FileMode.CreateNew, FileAccess.ReadWrite);
987-
988-
//Save and close the PDF document.
989-
990-
document.Save(fileStream);
991-
992-
document.Close(true);
993-
994-
document.Dispose();
995-
996-
fileStream.Dispose();
997-
998-
{% endhighlight %}
999-
{% endtabs %}
1000-
</td>
1001-
</tr>
1002-
1003-
</table>
1005+
</ol>

0 commit comments

Comments
 (0)