Hello Community,
recently i created a visualforce page to create a PDF, in the current process i uploaded a photo from field service mobile by directly take a photo from camera (with portrait orientation).
but in my PDF, the photos is automatically changed to landscape, even though in the related record the files is portrait.
why this is happening? is my code not working or anything else?
NB :
i take a photo from samsung and iphone smartphone
#Salesforce Developer
Hello Irfan,
This issue happens because mobile devices store images with an
EXIF orientation tag instead of actually rotating the pixels. When you take a picture in portrait mode, the image file itself is often saved in landscape orientation, but the EXIF metadata contains information to display it correctly.However, when generating a PDF using Visualforce and rendering it as a PDF, the EXIF data is often ignored, causing the image to appear in its original landscape orientation. Possible solutions to show it as it is manually Rotate the Image Before Displaying in PDF, use a Wrapper Apex Class to Rotate the Image or convert the Image to Base64 and Use an Online EXIF Fixer.