Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Wed May 24, 2023 2:14 pm

Hi ,
After updating Spire.Pdf to version 9.5.4 and Spire.Doc to version 11.5.6 we notes problem that sometime document after loading from saved blob has page.count 0 and other time same document has page.count in this case 27. All we do is getting data from azure blob to PdfDocument

byte[] fileData data receive by reading from blob
PdfDocument doc = new PdfDocument();
doc.LoadFromBytes(fileData);
doc.Page.Count =>some time 0 sometime 27

Please check more then once we can't conclude anything and we did not change file in any way.
File is more then 3MB so I can't send it trough this form , is there a way to send this file to you?

Regards

bstojanovic
 
Posts: 45
Joined: Mon Sep 28, 2020 2:54 pm

Thu May 25, 2023 2:42 am

Hello,

Thanks for your inquiry.
I simulated a PDF file and did an initial test, but did not reproduce your issue. In order to help us investigate your issue quickly and effectively, please provide the following information for our reference. You could send them to us via email (support@e-iceblue.com). Thanks in advance.
1) Your sample PDF file .
2) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).
3) Your application type, such as Console app (. Net Framework 4.5).

Sincerely
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Wed Jun 14, 2023 1:50 pm

I created a smaller sample of a code where you can see this behavior, we load file from disk in to PdfDocument , do some watermarking , and save it to disk . When we load saved version it shows 0 pages instead of 27 as document originally had. This behavior we can't see in all files just some. My file has a little over 3M so I can't upload it is there any other way to send it?
Code :

PdfDocument doc = new PdfDocument();
doc.LoadFromFile(@"someLocation\Fridge Freezer.pdf");

SizeF sizeP = doc.Pages[0].Size;
int fontSize = 0;
string text = "ITS";
foreach (PdfPageBase page in doc.Pages)//page count is 27
{
PdfTilingBrush brush = new PdfTilingBrush(new SizeF(page.Canvas.ClientSize.Width / 2, page.Canvas.ClientSize.Height / 3));
if (page.Canvas.ClientSize.Width > page.Canvas.ClientSize.Height * 1.3)
{
brush = new PdfTilingBrush(new SizeF(page.Canvas.ClientSize.Width / 3, page.Canvas.ClientSize.Height / 2));
}
else if (page.Canvas.ClientSize.Width * 1.3 < page.Canvas.ClientSize.Height)
{

brush = new PdfTilingBrush(new SizeF(page.Canvas.ClientSize.Width / 2, page.Canvas.ClientSize.Height / 3));
}
else
{
brush = new PdfTilingBrush(new SizeF(page.Canvas.ClientSize.Width / 2, page.Canvas.ClientSize.Height / 2));
}
if (fontSize == 0 || sizeP != page.Size)
{
sizeP = page.Size;


int textLength = text.Length;
int margin = 0;
if (textLength > 30) margin = 5;
else if (textLength > 20) margin = 10;
else if (textLength > 10) margin = 20;
else if (textLength > 5) margin = 40;
else margin = 50;
if (brush.Size.Width < brush.Size.Height)
{
fontSize = CalculateFont(brush.Size.Width * 1.14 - brush.Size.Width * margin / 100, text, 20);
}
else
{
fontSize = CalculateFont(brush.Size.Height * 1.14 - brush.Size.Height * margin / 100, text, 20);
}

}
brush.Graphics.SetTransparency(0.3f);
brush.Graphics.Save();
brush.Graphics.TranslateTransform(brush.Size.Width / 2, brush.Size.Height / 2);
brush.Graphics.RotateTransform(-45);
brush.Graphics.DrawString(text, new PdfFont(PdfFontFamily.Helvetica, fontSize), PdfBrushes.Violet, 0, 0, new PdfStringFormat(PdfTextAlignment.Center));
brush.Graphics.Restore();
brush.Graphics.SetTransparency(1);
page.Canvas.DrawRectangle(brush, new RectangleF(new PointF(0, 0), page.Canvas.ClientSize));
}


doc.SaveToFile(@"someLocation\Fridge Freezer_new.pdf");
doc.LoadFromFile(@"someLocation\Fridge Freezer_new.pdf");





int a = doc.Pages.Count; //count is 0

bstojanovic
 
Posts: 45
Joined: Mon Sep 28, 2020 2:54 pm

Thu Jun 15, 2023 7:32 am

Hello,

Thanks for your response.
Please send your input PDF file to us through this email (support@e-iceblue.com) so that we can investigate your issue. Thank you in advance.

Sincerely,
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Fri Jun 16, 2023 8:37 am

Hello,

Thanks for sharing the information via email.
I tested your PDF file and did reproduce the issue you mentioned(Sometimes the `pages.Count` is 0 and sometimes it's 27). I have logged the issue into our bug tracking system with the ticket number SPIREPDF-6072. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.

Sincerely
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Fri Jul 21, 2023 1:28 am

Hello,

Thank you for your patience!
Glad to inform you that we just released Spire.PDF Pack(Hot Fix) Version:9.7.14, which fixed your issue SPIREPDF-6072. Please use this version to test.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link:https://www.nuget.org/packages/Spire.PDF/9.7.14

Sincerely
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Wed Jul 26, 2023 9:03 am

When apply new version that you suggested I find problem with licensing
Spire.License.LicenseProvider LicenseProvider das not exist anymore? How do we add license for new versions?

bstojanovic
 
Posts: 45
Joined: Mon Sep 28, 2020 2:54 pm

Wed Jul 26, 2023 9:37 am

Hello,

Thanks for your inquiry.
Starting from version 9.6.0 of Spire.PDF, we have made changes to the licensing method. Please update your application's applying licensing key using the following code:
Code: Select all
Spire.Pdf.License.LicenseProvider.SetLicenseKey("your license key");

You can also refer to the following link for using licenses with other Spire products:
https://www.e-iceblue.com/Tutorials/Licensing/Licensing.html#Apply_by_Key
We apologize for any inconvenience caused and for not notifying you in a timely manner.

Sincerely,
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Wed Jul 26, 2023 10:36 am

We did not go to new version because we hade open issues , now I can say we found new one. The file with 'odt' extension that we were able to convert to 'pdf' we can't convert with latest version, we are reading data from blob but it is the same if you read from some location.
Code example:
MemoryStream memoryStream = new MemoryStream(fileData)
Document document2 = new Document();
DocFileFormat ff1 = new DocFileFormat();
ff1= DocFileFormat.Odt;
document2 = new Document(memoryStream, ff1);

it breaks on last line. Test with some other documents work, but with document in attachment it breaks with wrong type message. This conversion with older version that we are still on (PDF 9.1.0 version, Doc 11.1.0 version) is working with the same file .
Regards.

bstojanovic
 
Posts: 45
Joined: Mon Sep 28, 2020 2:54 pm

Thu Jul 27, 2023 2:16 am

Hello,

Thank you for your feedback.
I tested your odt file and did reproduce the issue you mentioned using the latest version of Spire.Doc(Spire.Doc Pack(hot fix) Version:11.7.15). I have logged the issue into our bug tracking system with the ticket number SPIREDOC-9716. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.

Sincerely,
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Fri Sep 15, 2023 10:20 am

Do you have any new information about this ticket: SPIREDOC-9716

bstojanovic
 
Posts: 45
Joined: Mon Sep 28, 2020 2:54 pm

Mon Sep 18, 2023 1:42 am

Hello,

Thank you for your follow-up.
I apologize that the issue SPIREDOC-9716 has not been fully resolved yet. Our developers are still working on it. Once there is significant progress, I will inform you promptly. Thank you for your cooperation.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Wed Nov 08, 2023 9:00 am

Hello,

Thanks for your patient waiting.
I’m writing to inform you that the SPIREDOC-9716 has been resolved. Please download the hotfix (Spire.Doc Pack(hot fix) Version:11.11.0) from the following link and test it.

Website download link: https://www.e-iceblue.com/Download/download-word-for-net-now.html
Nuget download link: https://www.nuget.org/packages/Spire.Doc/11.11.0

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Thu Nov 23, 2023 2:39 pm

Hi,
Thank you for reply this resolve the issue .
Regards
Biljana.

bstojanovic
 
Posts: 45
Joined: Mon Sep 28, 2020 2:54 pm

Fri Nov 24, 2023 8:13 am

Hello,

You're welcome.
If you encounter other issues related to our products in the future, please feel free to contact us.
Have a nice day.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF