Rotating a vertically form page, when entering an input field

Hello,

this is a bit difficult to explain, but a customer has some pdf forms that are shown rotated by 90 degrees on pages in a pdf that is formated normally on other pages. I have attached such a pdf.
Has anyone an idea if it would be possible to rotate this one page in the SfPdfViewer as soon as someone enters a text field? So it would be possible to normally enter the data, but you dont have to rotate the form in the pdf for printing purposes?

Thanks a lot for any idea on this.
Thomas

Attachment: 97338_52_Arbeitsplanung.pdf_7197eab5.zip

5 Replies 1 reply marked as answer

AG Aribalakrishnan Govindasamy Syncfusion Team November 13, 2020 04:49 PM UTC

Hi Thomas, 

Please let us know more details about use case scenario. 

Regards, 
Aribalakrishnan G. 



TS Thomas Stark December 7, 2020 08:11 PM UTC

Hello,

ist it possible to rotate a single page in sfPDFViewer by 90 degrees? Our costumer has some pages that are rotated by 90 degrees in a pdf. In the viewer it would be nice to be able to rotate it back, so the user can read it and fill the form.
I have attached such a pdf as example where pages 2 and 3 are rotated from horizontal to vertical to use the full hight especially for printing purposes.

I didn't fine such an ability besides rotating the whole document.


Thanks for any feedback on this.

Regards
Thomas

Attachment: 97341_6769_Bewertungsuebersicht_Interaktiv_(1).pdf_f13fe85c.zip


AV Ashokkumar Viswanathan Syncfusion Team December 8, 2020 08:29 AM UTC

Hi Thomas, 
 
Thank you for providing requested details, 
 
Yes, it is possible to rotate the PDF pages by 90 degrees before loading in to the SfPdfViewer control.  
 
Please refer the below code snippet to rotate the PDF pages, 
            Assembly assembly = typeof(MainPage).GetTypeInfo().Assembly; 
            Stream fileStream = assembly.GetManifestResourceStream("PdfViewerCustomToolbar.Assets.97341_67-69_Bewertungsuebersicht_Interaktiv (1).pdf"); 
            byte[] buffer = new byte[fileStream.Length]; 
            fileStream.Read(buffer, 0, buffer.Length); 
            PdfLoadedDocument ldoc = new PdfLoadedDocument(buffer); 
            foreach(PdfLoadedPage page in ldoc.Pages) 
            {   
                  //Rotates the PDF page to 90 degree 
                  page.Rotation = PdfPageRotateAngle.RotateAngle90;                
            } 
            MemoryStream strm = new MemoryStream(); 
            ldoc.Save(strm); 
            strm.Position = 0; 
            pdfViewer.LoadDocument(strm); 
 
Please find the UG documentation below, 
 
Please let us know whether provided solution resolved your issue.  
 
Regards, 
Ashok Kumar Viswanathan. 


Marked as answer

TS Thomas Stark December 8, 2020 10:01 AM UTC

Hello,

thank you very much for this code example.
But would it also be possible to rotate a single page inside of the sfPDFViewer. If a user wants to rotate a page while already viewing the pdf page?
I guess not, but just to be sure on that.
And also to be certain on this: This surely also works when loading the pdf from file system not the assets.

Regards
Thomas


AV Ashokkumar Viswanathan Syncfusion Team December 9, 2020 06:33 AM UTC

Hi Thomas,  
At present, we do not have the support to rotate the PDF pages which are displayed in our SfPdfViewer control. However, we do not have any immediate plans to implement this feature. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. 
  
Based on our present commitments and the above parameters, this feature is expected to be implemented in our 2021 Volume 3 main release. We will let you know when this feature is implemented. 
  
Disclaimer: The date for the feature implementation is tentative and not a commitment on our parts. 
 
Please find the feedback to track the status, 
 
Regards, 
Ashok Kumar Viswanathan. 


Loader.
Up arrow icon