PDF PageInfo gives wrong dimensions

hi again

seems PageInfo gives wrong width and height, switched maybe ?
image.png (10.9 KB)

pdf:

code:
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(pdf);
var slide_width = doc.PageInfo.Width;
var slide_height = doc.PageInfo.Height;

win11/4.8/23.30

thanks

@pcaillol,

It looks like a bug. I will be creating a ticket for the dev team.

@pcaillol
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-54042

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Thank you ! :slight_smile:

it seems dimensions are not read !

They are the same dimensions for both landscape and portrait PDF files.

here is portrait pdf:

do you confirm ?

thanks.

@pcaillol,

Yes, it seems that way. The dev team is already informed.

thank you so much

1 Like

hi

same problem with that file:

when will fix be published please ?

thanks.

@pcaillol,

As I have mentioned in other posts. I do not know. Please read the “Free support policies.”.

I do not have any extra information I can provide since we are different teams, and they do not require to give us any input. As I said before, you will be notified by a bot automatically when a fix is done.

alright thanks.

Otherwise, when exporting PDF to PNG, images can reach up to gigantic dimensions, how to limit size by height or width (automatic resize before saving image to disk) please ?

because we cannot foresee image dimensions before exporting them…

thanks.

my code:

Aspose.Pdf.Document doc = new Aspose.Pdf.Document(pdf);
var export_resolution = new Aspose.Pdf.Devices.Resolution(300);
var imageDevice = new Aspose.Pdf.Devices.PngDevice(export_resolution);
for (int pageCount = 1; pageCount <= doc.Pages.Count; pageCount++)
{
var slideName = “Slide” + pageCount.ToString(“0000”) + “.png”;
try
{
var slide_path = Path.Combine(thumbspath, slideName);
using (FileStream imageStream = new FileStream(slide_path, FileMode.Create))
{
imageDevice.Process(doc.Pages[pageCount], imageStream);
imageStream.Close();
}
}
catch (Exception ex)
{ }
}
if (doc != null)
{
doc.Dispose();
doc = null;
}

@pcaillol,

You cannot limit the conversion by size but you can lower the resolution.

ok but do you imagine detailed picture in big/huge resolution if we lower the resolution ?..

the solution is to add a height or width limit and automatic internal autoscale before saving each image.

Can you open a ticket please ?

This is paramount.

thanks.

@pcaillol,

I cannot. Since it is is not a bug.

Also, PngDevice has Height and Width properties too.

OK let’s think that way:

I am a R&D developer and my company has paid 7000$ for libraries full of bugs (i have opened around 30 cases for Aspose.Slides and Aspose.PDF within two months !) and existing exporting function is incomplete to make a correct usage:

How to keep the ratio when you limit the size by width and height with no resizing without knowing size of pictures in advance ?

The aim is to keep a relevant image. keep resolution and lower the resolution is insane.

This function has to propose an option to export based on a limited width or height too.

Waiting for a positive answer to my request.

Thanks.

@pcaillol,

The purpose of this forum, which is “free support”, is to help people to use correctly the API. If there is a bug, we report it to the dev team, which they will accommodate to fix in a future release.

Anything like paid support, special request, or something else can be done via Paid support. That has been the ruling of the company, not mine.

Also, you are asking for a brand-new functionality to accommodate your needs, which has nothing wrong but is not the purpose of this forum. You need to talk with the special support team instead of the free one here.

Useless to talk on that subject.

Your function should include that option from the beginning, which would be a normal thing instead of a clever one.

How to use correctly an API when this has been inappropriately thought: no support whatsoever could help on that question.

Cheers.

Waiting for all my tickets to be solved.

Thanks.

@pcaillol,

I am sorry the API does not do what you need to, but my hands are tied to what currently does, since I have no input on what will be added or when thing will be fixed.

I know and i am sure you understand my perspective.

Thank you for your help.

By the way, how to do that please ?

“You need to talk with the special support team instead of the free one here.”

@pcaillol,

You can contact them via this link: https://helpdesk.aspose.com/

That will get this:

  • Comprehensive support on a priority basis
  • Direct access to Paid Support management team
  • Use of our issue tracking system