Comments (3)
Are you including the projects as source or using pre-built dlls?
Do you have file/folder permissions? Specifically in UWP you need to use either the default app directory, specify library folders to require access to in your manifest, or get a file/folder permission via a file/folder picker (you can then save permissions for future executions). This means you can't just pass a string file name as most examples seem to show.
In case it is useful I have a small excerpt of how I save my migradoc documents (I'm also new). This assumes you already saved permissions for a custom folder. If you aren't using migradoc, and just pdfsharp you likely need the same arguments anyway.
StorageFolder folder = null;
if (StorageApplicationPermissions.FutureAccessList.ContainsItem("mytokenname"))
{
folder = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync("mytokenname");
}
var pdfRenderer = new PdfDocumentRenderer(true);
// Set the MigraDoc document.
pdfRenderer.Document = _document;
// Create the PDF document.
pdfRenderer.RenderDocument();
// Save the PDF document...
Stream newFile = await folder.OpenStreamForWriteAsync(filename, CreationCollisionOption.ReplaceExisting);
pdfRenderer.Save(newFile, true);
from pdfsharpcore.
I am rewriting my .Net4.5 application that ran as admin so the folder permission issue is new to me ;)
@o-leary Your code snippet was very helpful and I am now on my way. I ended up using a folder picker to save a token.
Thanks again @groege for your wonderful work!
from pdfsharpcore.
Since this is a general problem I'm closing the issue ;)
from pdfsharpcore.
Related Issues (20)
- [Question] Are those package available on nuget? HOT 6
- .net core 2.0 and vs2017 support HOT 4
- Conversion from HTML to pdf HOT 1
- DrawRoundedRectangle is not working in UWP
- PdfReader.Open bug HOT 3
- Upgrade to latest ImageSharp library?
- Adding Image cause an System.NullReferenceException HOT 12
- Font baseline misaligned? HOT 1
- Getting error while generating PDF
- Error for run
- Image rendering issue HOT 1
- install PDFSharp.Xamarin.Forms HOT 1
- What is the correct way to place a picture.
- Crash: PdfSharp.Xamarin.Forms already initialized before HOT 3
- Android: NullReferenceException @ Image.AsJpeg() / Document.Save() HOT 1
- Filling comb text field
- Adding Image throws System.AggregateException HOT 11
- Null Reference exception when Encrypting a PDF document HOT 5
- Outdated NuGet package HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdfsharpcore.