Skip to content
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

Scryber is not filling the template. #136

Open
Matt-17 opened this issue May 5, 2024 · 1 comment
Open

Scryber is not filling the template. #136

Matt-17 opened this issue May 5, 2024 · 1 comment

Comments

@Matt-17
Copy link

Matt-17 commented May 5, 2024

Describe the bug
I just wanted to get into Scryber, as it seems very promising. But I cannot even get the minimal sample to work.

To Reproduce

  • Create a new .Net8.0 project
  • Install-Package Scryber.Core (Version 5.0.7)
  • Create a Test.html
<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>Hello World</title>
</head>
<body>
    Hello {{author}}!
</body>
</html>
  • Add this code to Program.cs
using Scryber.Components;

using var doc = Document.ParseDocument("Test.html");
doc.Params["author"] = "Hello World";
using var stream = new MemoryStream();
doc.SaveAsPDF(stream);

var fileContents = stream.ToArray();
File.WriteAllBytes("Test.pdf", fileContents);
  • Start program
  • PDF shows "Hello {{author}}!"

Expected behavior
A PDF saying "Hello Hello World!"

Screenshots
grafik

Desktop (please complete the following information):

  • OS: Windows 10

Additional context
Is there anything I missed? I used https://scrybercore.readthedocs.io/en/latest/ to create this.

@richard-scryber
Copy link
Owner

Hi @Matt-17, sorry for the slow response.

If you haven't managed to sort this, please upgrade to the latest version 6.x.x (beta) - There are a few things we need to sort before really pushing it out and these may affect layout.

Version 5 docs are here, and use the {@:author} notation.

I hope this helps.

Richard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants