Skip to content

Commit e9f1f0e

Browse files
committed
fix: use Personal Access Token for release creation
Research shows the 422 'author_id' error is a known limitation of GITHUB_TOKEN in organization repositories. The default token lacks sufficient permissions to create releases in some org contexts. Solution: Use a Personal Access Token (PAT) with repo scope instead. Instructions to fix: 1. Create a PAT: Settings → Developer Settings → Personal Access Tokens → Fine-grained tokens 2. Grant 'Contents' read/write permissions to TheEightBot/MauiNativePdfView 3. Add as repository secret named GH_PAT 4. Re-run workflow Reference: https://docs.github.com/en/rest/releases/releases\#create-a-release
1 parent b587c86 commit e9f1f0e

5 files changed

Lines changed: 129 additions & 134 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
permissions:
1010
contents: write
1111
packages: write
12+
discussions: write
1213

1314
env:
1415
DOTNET_VERSION: '9.0.x'
@@ -96,9 +97,8 @@ jobs:
9697
9798
- name: Create GitHub Release
9899
if: startsWith(github.ref, 'refs/tags/v')
99-
uses: softprops/action-gh-release@v1
100+
uses: softprops/action-gh-release@v2
100101
with:
101102
files: ./artifacts/*.nupkg
102103
generate_release_notes: true
103-
env:
104-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
token: ${{ secrets.GH_PAT }}
Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,73 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
33
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
44
xmlns:pdf="clr-namespace:MauiNativePdfView;assembly=MauiNativePdfView"
55
x:Class="MauiPdfViewerSample.PdfTestPage"
66
Title="PDF Test">
7-
8-
<Grid RowDefinitions="Auto,*,Auto" Padding="10">
9-
7+
<Grid RowDefinitions="Auto,*,Auto"
8+
Padding="10">
109
<!-- Header with controls -->
11-
<VerticalStackLayout Grid.Row="0" Spacing="10" Padding="0,0,0,10">
12-
<Label Text="PDF Viewer Test"
13-
FontSize="24"
10+
<VerticalStackLayout Grid.Row="0"
11+
Spacing="10"
12+
Padding="0,0,0,10">
13+
<Label Text="PDF Viewer Test"
14+
FontSize="24"
1415
FontAttributes="Bold"
1516
HorizontalOptions="Center" />
16-
17-
<HorizontalStackLayout Spacing="10" HorizontalOptions="Center">
18-
<Button x:Name="LoadFileButton"
19-
Text="Load Sample PDF"
17+
<HorizontalStackLayout Spacing="10"
18+
HorizontalOptions="Center">
19+
<Button x:Name="LoadFileButton"
20+
Text="Load Sample PDF"
2021
Clicked="OnLoadFileClicked" />
21-
<Button x:Name="LoadAnnotationFileButton"
22-
Text="Load Annotations PDF"
22+
<Button x:Name="LoadAnnotationFileButton"
23+
Text="Load Annotations PDF"
2324
Clicked="OnLoadAnnotationFileClicked" />
24-
<Button x:Name="PrevPageButton"
25-
Text="◀ Prev"
25+
<Button x:Name="PrevPageButton"
26+
Text="◀ Prev"
2627
Clicked="OnPrevPageClicked"
2728
IsEnabled="False" />
28-
<Button x:Name="NextPageButton"
29-
Text="Next ▶"
29+
<Button x:Name="NextPageButton"
30+
Text="Next ▶"
3031
Clicked="OnNextPageClicked"
3132
IsEnabled="False" />
3233
</HorizontalStackLayout>
33-
3434
<!-- New Phase 4 Features -->
35-
<HorizontalStackLayout Spacing="10" HorizontalOptions="Center">
36-
<Label Text="Orientation:" VerticalOptions="Center" />
35+
<HorizontalStackLayout Spacing="10"
36+
HorizontalOptions="Center">
37+
<Label Text="Orientation:"
38+
VerticalOptions="Center" />
3739
<Button x:Name="ToggleOrientationButton"
3840
Text="Toggle (Vertical)"
3941
Clicked="OnToggleOrientationClicked" />
40-
41-
<Label Text="Background:" VerticalOptions="Center" Margin="20,0,0,0" />
42+
<Label Text="Background:"
43+
VerticalOptions="Center"
44+
Margin="20,0,0,0" />
4245
<Button x:Name="ToggleBackgroundButton"
4346
Text="Change"
4447
Clicked="OnToggleBackgroundClicked" />
4548
</HorizontalStackLayout>
46-
4749
<!-- New Phase 5 Features -->
48-
<HorizontalStackLayout Spacing="10" HorizontalOptions="Center">
49-
<Label Text="Display Mode:" VerticalOptions="Center" />
50+
<HorizontalStackLayout Spacing="10"
51+
HorizontalOptions="Center">
52+
<Label Text="Display Mode:"
53+
VerticalOptions="Center" />
5054
<Button x:Name="ToggleDisplayModeButton"
5155
Text="Single Page Continuous"
5256
Clicked="OnToggleDisplayModeClicked" />
5357
</HorizontalStackLayout>
54-
5558
<!-- New Phase 7 Features -->
56-
<HorizontalStackLayout Spacing="10" HorizontalOptions="Center">
57-
<Label Text="Annotations:" VerticalOptions="Center" />
59+
<HorizontalStackLayout Spacing="10"
60+
HorizontalOptions="Center">
61+
<Label Text="Annotations:"
62+
VerticalOptions="Center" />
5863
<Button x:Name="ToggleAnnotationsButton"
5964
Text="Enabled"
6065
Clicked="OnToggleAnnotationsClicked" />
6166
</HorizontalStackLayout>
6267
</VerticalStackLayout>
63-
6468
<!-- PDF Viewer -->
65-
<Border Grid.Row="1"
66-
Stroke="Gray"
69+
<Border Grid.Row="1"
70+
Stroke="Gray"
6771
StrokeThickness="1"
6872
BackgroundColor="White">
6973
<pdf:PdfView x:Name="PdfViewer"
@@ -80,26 +84,25 @@
8084
Rendered="OnPdfRendered"
8185
AnnotationTapped="OnAnnotationTapped" />
8286
</Border>
83-
8487
<!-- Status bar -->
85-
<VerticalStackLayout Grid.Row="2" Spacing="5" Padding="0,10,0,0">
86-
<Label x:Name="StatusLabel"
87-
Text="Ready - Tap 'Load Sample PDF' to begin"
88+
<VerticalStackLayout Grid.Row="2"
89+
Spacing="5"
90+
Padding="0,10,0,0">
91+
<Label x:Name="StatusLabel"
92+
Text="Ready - Tap 'Load Sample PDF' to begin"
8893
HorizontalOptions="Center"
8994
FontSize="12"
9095
TextColor="Gray" />
91-
<Label x:Name="PageInfoLabel"
92-
Text=""
96+
<Label x:Name="PageInfoLabel"
97+
Text=""
9398
HorizontalOptions="Center"
9499
FontSize="12"
95100
TextColor="DarkBlue" />
96-
<Label x:Name="AnnotationInfoLabel"
97-
Text=""
101+
<Label x:Name="AnnotationInfoLabel"
102+
Text=""
98103
HorizontalOptions="Center"
99104
FontSize="12"
100105
TextColor="DarkGreen" />
101106
</VerticalStackLayout>
102-
103107
</Grid>
104-
105-
</ContentPage>
108+
</ContentPage>

samples/MauiPdfViewerSample/PdfTestPage.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private void OnLoadFileClicked(object? sender, EventArgs e)
3535
try
3636
{
3737
StatusLabel.Text = "Loading PDF...";
38-
38+
3939
// Load from raw asset
4040
PdfViewer.Source = PdfSource.FromAsset("sample.pdf");
4141
}
@@ -51,7 +51,7 @@ private void OnLoadAnnotationFileClicked(object? sender, EventArgs e)
5151
try
5252
{
5353
StatusLabel.Text = "Loading PDF with annotations...";
54-
54+
5555
// Load PDF with annotations from raw asset
5656
PdfViewer.Source = PdfSource.FromAsset("sample_with_annotations.pdf");
5757
}
Lines changed: 35 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
12
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFramework>net9.0-android</TargetFramework>
4-
<SupportedOSPlatformVersion>24</SupportedOSPlatformVersion>
5-
<Nullable>enable</Nullable>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<!--
8-
Enable trim analyzers for Android class libraries.
9-
To learn more, see: https://learn.microsoft.com/dotnet/core/deploying/trimming/prepare-libraries-for-trimming
10-
-->
11-
<IsTrimmable>true</IsTrimmable>
12-
13-
<!-- Package Information -->
14-
<PackageId>MauiNativePdfView.Android.Binding</PackageId>
15-
<Version>1.0.0</Version>
16-
<Authors>MauiNativePdfView Contributors</Authors>
17-
<Company>MauiNativePdfView</Company>
18-
<Product>MauiNativePdfView Android Binding</Product>
19-
<Description>.NET Android binding for AhmerPdfium - A maintained fork of AndroidPdfViewer with 16KB page size support and reliable PDF rendering. This binding is used by MauiNativePdfView for Android platform support.</Description>
20-
<PackageProjectUrl>https://github.com/mstonis/MauiNativePdfView</PackageProjectUrl>
21-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
22-
<RepositoryUrl>https://github.com/mstonis/MauiNativePdfView</RepositoryUrl>
23-
<RepositoryType>git</RepositoryType>
24-
<PackageTags>maui;android;pdf;pdfviewer;binding;ahmer-pdfium;native</PackageTags>
25-
<Copyright>Copyright (c) 2025 MauiNativePdfView Contributors</Copyright>
26-
27-
<!--
28-
AAR files in the Jars directory are automatically included.
29-
AhmerPdfium v1.9.2 and AhmerPdfViewer v2.0.1
30-
-->
31-
</PropertyGroup>
32-
33-
<ItemGroup>
34-
<!-- Explicitly declare AAR files for clarity -->
35-
<AndroidLibrary Include="Jars\ahmer-pdfium-1.9.2.aar" />
36-
<AndroidLibrary Include="Jars\ahmer-pdfviewer-2.0.1.aar" />
37-
</ItemGroup>
38-
39-
<ItemGroup>
40-
<!-- Kotlin standard library dependency -->
41-
<PackageReference Include="Xamarin.Kotlin.StdLib" Version="2.1.0" />
42-
</ItemGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net9.0-android</TargetFramework>
5+
<SupportedOSPlatformVersion>24</SupportedOSPlatformVersion>
6+
<Nullable>enable</Nullable>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<!-- Enable trim analyzers for Android class libraries.
9+
To learn more, see: https://learn.microsoft.com/dotnet/core/deploying/trimming/prepare-libraries-for-trimming -->
10+
<IsTrimmable>true</IsTrimmable>
11+
<!-- Package Information -->
12+
<PackageId>eightbot.MauiNativePdfView.Android.Binding</PackageId>
13+
<Version>1.0.0</Version>
14+
<Authors>MauiNativePdfView Contributors</Authors>
15+
<Company>MauiNativePdfView</Company>
16+
<Product>MauiNativePdfView Android Binding</Product>
17+
<Description>.NET Android binding for AhmerPdfium - A maintained fork of AndroidPdfViewer with 16KB page size support and reliable PDF rendering. This binding is used by MauiNativePdfView for Android platform support.</Description>
18+
<PackageProjectUrl>https://github.com/TheEightBot/MauiNativePdfView</PackageProjectUrl>
19+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
20+
<RepositoryUrl>https://github.com/TheEightBot/MauiNativePdfView</RepositoryUrl>
21+
<RepositoryType>git</RepositoryType>
22+
<PackageTags>maui;android;pdf;pdfviewer;binding;ahmer-pdfium;native</PackageTags>
23+
<Copyright>Copyright (c) 2025 MauiNativePdfView Contributors</Copyright>
24+
<!-- AAR files in the Jars directory are automatically included.
25+
AhmerPdfium v1.9.2 and AhmerPdfViewer v2.0.1 -->
26+
</PropertyGroup>
27+
<ItemGroup>
28+
<!-- Explicitly declare AAR files for clarity -->
29+
<AndroidLibrary Include="Jars\ahmer-pdfium-1.9.2.aar" />
30+
<AndroidLibrary Include="Jars\ahmer-pdfviewer-2.0.1.aar" />
31+
</ItemGroup>
32+
<ItemGroup>
33+
<!-- Kotlin standard library dependency -->
34+
<PackageReference Include="Xamarin.Kotlin.StdLib"
35+
Version="2.1.0" />
36+
</ItemGroup>
4337
</Project>
Lines changed: 44 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
12
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<TargetFrameworks>net9.0-android;net9.0-ios</TargetFrameworks>
5-
<!-- Removed Mac Catalyst and Windows for initial implementation -->
6-
7-
<UseMaui>true</UseMaui>
8-
<SingleProject>true</SingleProject>
9-
<ImplicitUsings>enable</ImplicitUsings>
10-
<Nullable>enable</Nullable>
11-
12-
<!-- Package Information -->
13-
<PackageId>MauiNativePdfView</PackageId>
14-
<Version>1.0.0</Version>
15-
<Authors>MauiNativePdfView Contributors</Authors>
16-
<Company>MauiNativePdfView</Company>
17-
<Product>MauiNativePdfView</Product>
18-
<Description>High-performance, cross-platform PDF viewer for .NET MAUI using native controls. Features native PDF rendering with PDFKit (iOS) and AhmerPdfium (Android), zero web dependencies, full annotation support, and comprehensive event system.</Description>
19-
<PackageProjectUrl>https://github.com/mstonis/MauiNativePdfView</PackageProjectUrl>
20-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
21-
<RepositoryUrl>https://github.com/mstonis/MauiNativePdfView</RepositoryUrl>
22-
<RepositoryType>git</RepositoryType>
23-
<PackageTags>maui;pdf;pdfviewer;ios;android;pdfkit;ahmer-pdfium;native;cross-platform;annotations</PackageTags>
24-
<PackageReadmeFile>README.md</PackageReadmeFile>
25-
<PackageIcon>icon.png</PackageIcon>
26-
<Copyright>Copyright (c) 2025 MauiNativePdfView Contributors</Copyright>
27-
28-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">12.2</SupportedOSPlatformVersion>
29-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
30-
</PropertyGroup>
31-
32-
<ItemGroup>
33-
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.120" />
34-
</ItemGroup>
35-
36-
<!-- Package content -->
37-
<ItemGroup>
38-
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
39-
<None Include="..\..\images\icon.png" Pack="true" PackagePath="\" />
40-
</ItemGroup>
41-
42-
<!-- Android-specific references -->
43-
<ItemGroup Condition="$(TargetFramework.Contains('android'))">
44-
<ProjectReference Include="..\MauiNativePdfView.Android.Binding\MauiNativePdfView.Android.Binding.csproj" />
45-
</ItemGroup>
46-
47-
</Project>
3+
<PropertyGroup>
4+
<TargetFrameworks>net9.0-android;net9.0-ios</TargetFrameworks>
5+
<!-- Removed Mac Catalyst and Windows for initial implementation -->
6+
<UseMaui>true</UseMaui>
7+
<SingleProject>true</SingleProject>
8+
<ImplicitUsings>enable</ImplicitUsings>
9+
<Nullable>enable</Nullable>
10+
<!-- Package Information -->
11+
<PackageId>Eightbot.MauiNativePdfView</PackageId>
12+
<Version>1.0.0</Version>
13+
<Authors>MauiNativePdfView Contributors</Authors>
14+
<Company>EighthBot, Inc.</Company>
15+
<Product>MauiNativePdfView</Product>
16+
<Description>High-performance, cross-platform PDF viewer for .NET MAUI using native controls. Features native PDF rendering with PDFKit (iOS) and AhmerPdfium (Android), zero web dependencies, full annotation support, and comprehensive event system.</Description>
17+
<PackageProjectUrl>https://github.com/TheEightBot/MauiNativePdfView</PackageProjectUrl>
18+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
19+
<RepositoryUrl>https://github.com/TheEightBot/MauiNativePdfView</RepositoryUrl>
20+
<RepositoryType>git</RepositoryType>
21+
<PackageTags>maui;pdf;pdfviewer;ios;android;pdfkit;ahmer-pdfium;native;cross-platform;annotations</PackageTags>
22+
<PackageReadmeFile>README.md</PackageReadmeFile>
23+
<PackageIcon>icon.png</PackageIcon>
24+
<Copyright>Copyright (c) 2025 MauiNativePdfView Contributors</Copyright>
25+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">12.2</SupportedOSPlatformVersion>
26+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
27+
</PropertyGroup>
28+
<ItemGroup>
29+
<PackageReference Include="Microsoft.Maui.Controls"
30+
Version="9.0.120" />
31+
</ItemGroup>
32+
<!-- Package content -->
33+
<ItemGroup>
34+
<None Include="..\..\README.md"
35+
Pack="true"
36+
PackagePath="\" />
37+
<None Include="..\..\images\icon.png"
38+
Pack="true"
39+
PackagePath="\" />
40+
</ItemGroup>
41+
<!-- Android-specific references -->
42+
<ItemGroup Condition="$(TargetFramework.Contains('android'))">
43+
<ProjectReference Include="..\MauiNativePdfView.Android.Binding\MauiNativePdfView.Android.Binding.csproj" />
44+
</ItemGroup>
45+
</Project>

0 commit comments

Comments
 (0)