Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Method to rotate a PDF CLOSE to completion!

(0) ShareShare
ReportReport
Posted on by 3,340

How hard should I work to make this happen?  I think I found a way... Should I write it up?

  • Sgeo Profile Picture
    Sgeo 2 on at
    Re: Method to rotate a PDF CLOSE to completion!

    Hi @martinav , for some reason i cannot explain, when i am in pdf viewer of my desktop app and hit with barcode scanner a qr code with link , pdf rotates one time clock wise!!! Qr code contains for example https://www.xxxxxxx.com. Maybe Carriage Return and Line Feed together is the solution!!!

     

  • Verified answer
    martinav Profile Picture
    martinav 3,340 on at
    Re: Method to rotate a PDF CLOSE to completion!

    I bailed on this.  Its not happening.  Too much effort.

  • martinav Profile Picture
    martinav 3,340 on at
    Re: Method to rotate a PDF CLOSE to completion!

    @v-xida-msft ,

     

    Its NOT pretty...  it involves doing some crazy base64 conversions and edits (is MS Flow) to change '/rotate 0/' to '/rotate 90/'.  Its gotten VERY complicated.  Its not quite working yet, and its exceedingly slow, because you have to do a "do until" loop to find the index of where its located in the base 64 file.  Being that base64 works in 4 character chunks, its really messy.  I had to put it aside for now.  

     

    Steps to completion:

    1. Find '/rotate 0/' in the base64 code (done)
    2. Find the index of the full block of base64 code that contains the '/rotate 0/' code. (done)
    3. strip off any extra characters from the last block (working on this now)
    4. Replace '/rotate 0/' with '/rotate 90/' in a full block (done)
    5. piece together new first half of the file with the 2nd half of the file (done)

    I was so close when I realized I was losing data from the last block when '/rotate 0/' only filled part of the last block.

     

    I cant believe how complex it has gotten.  Its like 25 steps right now.  Even when its done, if I cant narrow down the index of '/rotate 0/' more precicely, it may be too slow.  It has taken 30s to a minute until the "do until" is finished.

     

    *PRELIMINARY* View:

     

    image.png

  • v-xida-msft Profile Picture
    v-xida-msft on at
    Re: Method to rotate a PDF CLOSE to completion!

    Hi @martinav ,

    Yeah. Thanks for your sharing firstly.

    I think the solution you provided here would help many other users within this forum. I would also share this method to my colleagues.

     

    Best regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard