Git Product home page Git Product logo

Comments (3)

o-leary avatar o-leary commented on September 4, 2024 1

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.

Wetzel402 avatar Wetzel402 commented on September 4, 2024 1

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.

groege avatar groege commented on September 4, 2024

Since this is a general problem I'm closing the issue ;)

from pdfsharpcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.