0

I have PDF generated from third party. When I add that PDF to document like this:

var labelBytes = client.DownloadData(url);
var stream =  new MemoryStream(labelBytes);
Document labelDocument = new Document(labelStream);

I get PDF page horizontal, but content vertical: page horizontal instead of vertical

I tried to set page size but after that all content has shifted to bottom left corner of page :

 Document labelDocument = new Document(labelStream);
 PageCollection pageCollection = labelDocument.Pages;
 Page pdfPage = pageCollection[1];
 pdfPage.SetPageSize(597.6, 842.4);

Looks like this: content shifted to bottom left.

Has anyone ran to something similar or have more experience with Aspose libraries?

  • 1
    Did you read the documentation in (https://docs.aspose.com/pdf/net/rotate-pages/)? – Elec1 Jan 04 '23 at 09:12
  • Yes, by documentation width of page gets smaller by default. I can hardcode it to make it bigger but I wanted to see if there is some other way. If not, this can be maybe good enough since I need print functionality after generating that PDF and it will fit page by default – Aleksandar Dickov Jan 04 '23 at 10:08
  • You are already trying to use the correct method in order to change the page orientation. However, we will surely check other possible ways if you can please create a post in our dedicated support forum along with sample input and expected output PDF. We will respond you there accordingly. This is Asad Ali and I work as developer evangelist at Aspose. – Asad Ali Jan 05 '23 at 21:18
  • support forum (https://forum.aspose.com/c/pdf) – Asad Ali Jan 05 '23 at 21:24

0 Answers0