-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use images instead of pdf files for printing when viewer type is png …
…or jpeg
- Loading branch information
1 parent
d5e8951
commit 0c0de57
Showing
14 changed files
with
332 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base | ||
WORKDIR /app | ||
EXPOSE 80 | ||
EXPOSE 443 | ||
|
||
RUN sed -i'.bak' 's/$/ contrib/' /etc/apt/sources.list | ||
RUN apt update && apt install -y \ | ||
libgdiplus \ | ||
libc6-dev \ | ||
libx11-dev \ | ||
fontconfig \ | ||
ttf-mscorefonts-installer | ||
|
||
RUN fc-cache -f -v | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
WORKDIR /src | ||
COPY ["samples/GroupDocs.Viewer.UI.Sample.ViewAsPng/GroupDocs.Viewer.UI.Sample.ViewAsPng.csproj", "samples/GroupDocs.Viewer.UI.Sample.ViewAsPng/"] | ||
COPY ["src/GroupDocs.Viewer.UI/GroupDocs.Viewer.UI.csproj", "src/GroupDocs.Viewer.UI/"] | ||
COPY ["src/GroupDocs.Viewer.UI.Api/GroupDocs.Viewer.UI.Api.csproj", "src/GroupDocs.Viewer.UI.Api/"] | ||
COPY ["src/GroupDocs.Viewer.UI.Core/GroupDocs.Viewer.UI.Core.csproj", "src/GroupDocs.Viewer.UI.Core/"] | ||
COPY ["src/GroupDocs.Viewer.UI.Api.Local.Cache/GroupDocs.Viewer.UI.Api.Local.Cache.csproj", "src/GroupDocs.Viewer.UI.Api.Local.Cache/"] | ||
COPY ["src/GroupDocs.Viewer.UI.Api.Local.Storage/GroupDocs.Viewer.UI.Api.Local.Storage.csproj", "src/GroupDocs.Viewer.UI.Api.Local.Storage/"] | ||
COPY ["src/GroupDocs.Viewer.UI.SelfHost.Api/GroupDocs.Viewer.UI.SelfHost.Api.csproj", "src/GroupDocs.Viewer.UI.SelfHost.Api/"] | ||
RUN dotnet restore "./samples/GroupDocs.Viewer.UI.Sample.ViewAsPng/GroupDocs.Viewer.UI.Sample.ViewAsPng.csproj" | ||
COPY . . | ||
WORKDIR "/src/samples/GroupDocs.Viewer.UI.Sample.ViewAsPng" | ||
RUN dotnet build "./GroupDocs.Viewer.UI.Sample.ViewAsPng.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "./GroupDocs.Viewer.UI.Sample.ViewAsPng.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "GroupDocs.Viewer.UI.Sample.ViewAsPng.dll"] |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
63 changes: 63 additions & 0 deletions
63
samples/GroupDocs.Viewer.UI.Sample.ViewAsPng/GroupDocs.Viewer.UI.Sample.ViewAsPng.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>$(NetVersion)</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<UserSecretsId>ec7dd886-bc88-4c83-9991-a0d035628f15</UserSecretsId> | ||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | ||
<DockerfileContext>..\..</DockerfileContext> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="wwwroot\**" /> | ||
<Content Remove="wwwroot\**" /> | ||
<EmbeddedResource Remove="wwwroot\**" /> | ||
<None Remove="wwwroot\**" /> | ||
<Compile Remove="Cache\**" /> | ||
<Compile Remove="Files\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\GroupDocs.Viewer.UI\GroupDocs.Viewer.UI.csproj" /> | ||
<ProjectReference Include="..\..\src\GroupDocs.Viewer.UI.Api\GroupDocs.Viewer.UI.Api.csproj" /> | ||
<ProjectReference Include="..\..\src\GroupDocs.Viewer.UI.Api.Local.Cache\GroupDocs.Viewer.UI.Api.Local.Cache.csproj" /> | ||
<ProjectReference Include="..\..\src\GroupDocs.Viewer.UI.Api.Local.Storage\GroupDocs.Viewer.UI.Api.Local.Storage.csproj" /> | ||
<ProjectReference Include="..\..\src\GroupDocs.Viewer.UI.SelfHost.Api\GroupDocs.Viewer.UI.SelfHost.Api.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="Files\" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="Cache\" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="Files\password.pdf"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="Files\sample.docx"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="Files\sample.pdf"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="Files\sample.xlsx"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="Files\sample.pptx"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
<ItemGroup Label="runtimeconfig.json"> | ||
<RuntimeHostConfigurationOption Include="System.Drawing.EnableUnixSupport" Value="true" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using GroupDocs.Viewer.UI.Core; | ||
|
||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
ViewerType png = ViewerType.Png; | ||
|
||
builder.Services | ||
.AddGroupDocsViewerUI(config => | ||
{ | ||
//Preload first three pages | ||
config.SetPreloadPageCount(3); | ||
config.SetViewerType(png); | ||
}); | ||
|
||
builder.Services | ||
.AddControllers() | ||
.AddGroupDocsViewerSelfHostApi(config => | ||
{ | ||
config.SetViewerType(png); | ||
//Trial limitations https://docs.groupdocs.com/viewer/net/evaluation-limitations-and-licensing-of-groupdocs-viewer/ | ||
//Temporary license can be requested at https://purchase.groupdocs.com/temporary-license | ||
//config.SetLicensePath("c:\\licenses\\GroupDocs.Viewer.lic"); // or set environment variable 'GROUPDOCS_LIC_PATH' | ||
}) | ||
.AddLocalStorage("./Files") | ||
.AddLocalCache("./Cache"); | ||
|
||
var app = builder.Build(); | ||
|
||
app | ||
.UseRouting() | ||
.UseEndpoints(endpoints => | ||
{ | ||
endpoints.MapGet("/", async context => | ||
{ | ||
await context.Response.WriteAsync("Viewer UI can be accessed at '/viewer' endpoint."); | ||
}); | ||
endpoints.MapGroupDocsViewerUI(options => | ||
{ | ||
options.UIPath = "/viewer"; | ||
options.APIEndpoint = "/viewer-api"; | ||
}); | ||
endpoints.MapGroupDocsViewerApi(options => | ||
{ | ||
options.ApiPath = "/viewer-api"; | ||
}); | ||
}); | ||
|
||
app.Run(); |
9 changes: 9 additions & 0 deletions
9
samples/GroupDocs.Viewer.UI.Sample.ViewAsPng/appsettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
# GroupdocsViewerUI | ||
# Angular UI for GorupDocs.Viewer.UI | ||
|
||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.3. | ||
Building this app requires legacy tools that can be installed with `nvm`. | ||
|
||
## Development server | ||
### Prepare | ||
|
||
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. | ||
```bash | ||
nvm install 14.15 | ||
nvm use 14.15.5 | ||
npm install -g @angular/[email protected] | ||
npm install | ||
``` | ||
|
||
## Code scaffolding | ||
### Start dev server | ||
|
||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. | ||
```bash | ||
ng serve | ||
``` | ||
|
||
## Build | ||
### Build release packages | ||
|
||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. | ||
```bash | ||
npm run build | ||
``` | ||
|
||
## Further help | ||
|
||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. |
Oops, something went wrong.