-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Command- Convert-PnPFileToPdf #3435
Conversation
Really nice addition @NishkalankBezawada . Looks good to me. What do you think @gautamdsheth ? |
Hey @NishkalankBezawada - is it ok with you if I make changes here ? I actually found a different way to do this |
Hey @gautamdsheth, Sure thing, You may indeed 💯. But, I will also check-in my changes in resolving the comments, and you can compare those as well, if it is neccesary Thanks, |
@NishkalankBezawada - Actually, the way it will work is that it will support conversion of different files to different formats not just PDF, so if you haven't made the changes, don't start 😊 Sorry about this. |
Hey Again @gautamdsheth, Thats true, its just the parameter we pass for the conversion. However, I have almost completed my changes though. I was sick back then, so couldnt complete it before. Will send you out the review mostly by tomorrow. Thanks, |
Hello @gautamdsheth I have done the neccessary changes as suggested. Kindly review Thanks, |
Hello @KoenZomers & @gautamdsheth, Any update on this PR. Thanks, |
hi @NishkalankBezawada , sorry will have to close this PR. The mentioned PR takes care of quite a lot of different formats including PDF. Will be crediting you for sure. |
That was my idea #3616. I would have expected a help or may be you might have modified it later by enhancing it, adding new properties. I heard MVPs and Maintainers help out other enthusiasts, and I am sorry I am not at all satisified, @gautamdsheth @KoenZomers //Nishkalank |
hi @NishkalankBezawada , sorry about this. How do I fix this ? The code right now , as it is, looks good and we can merge it. Or , we can work together via review comments and improve it ? |
Hello @gautamdsheth I really appreciate for re-opening and saying that you will merge it. I didnt mean that you have overwritten the code. Its just the strategy, I got this idea first to use GraphAPI, and it should be welcomed. However, You later you got another idea, to get file and convert it to desired format using PnP, which is again brilliant and can be enhanced on top of the actually PR. I do understand your time and effort but would be really nice if you have discussed this without closing this PR. However, thanks once again for re-opening, you may merge it and probably enhance it later with your idea on saving a file in different formats. Thanks, I meant to say that, the scope for improvement should be seen. |
Hi @NishkalankBezawada ! You are correct. My mistake totally , will discuss first before doing anything. Regards, |
Type
Related Issues?
Fixes #3422
What is in this Pull Request ?
New command which converts a file in SharePoint to PDF.
Convert-PnPFileToPDF
Converts a file to Pdf, File contents can either be saved to local, returned as memorystream and can upload the file to SharePoint Online (Same Site Collection)
SYNTAX
Save to local path
Return as memorystream
Save to SharePoint Online (Same SiteCollection)
DESCRIPTION
Allows the conversion of a file from SharePoint Online. The file contents can either be directly saved to local disk, or stored in memory for further processing, or Can be uploaded back to SharePoint Online SiteCollection
EXAMPLES
EXAMPLE 1
Retrieves the file, converts to PDF, and outputs its content to the console as a Memory Stream
EXAMPLE 2
Retrieves the file, converts to PDF, and outputs its content to the console as a Memory Stream
EXAMPLE 3
Retrieves the file and converts to PDF, and save it to the given local path
EXAMPLE 4
Retrieves the file and converts to PDF, and save it to the given local path. Force parameter will override the existing file in the location where the document gets saved.
EXAMPLE 5
Retrieves the file and converts to PDF, and save it to the given Document library in SharePoint Online (Same Site Collection). Returns the saved file information in the console.
PARAMETERS
-Url
The URL (server or site relative) to the file
-AsMemoryStream
-Path
Local path where the file should be saved
-Force
Overwrites the file if it exists.
-Folder
The destination library in the site
RELATED LINKS
Microsoft 365 Patterns and Practices
Convert files to PDF using Graph API
I