Skip to content

Fix bug transparency watermark for PDF #71

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

Merged
merged 2 commits into from
Feb 4, 2021

Conversation

Antonio-Russo
Copy link
Contributor

There is a small but annoying bug that does not allow you to manage transparencies. Thanks

There is a small but annoying bug that does not allow you to manage transparencies. Thanks
…sparency

 Fix bug transparency watermark for PDF
@shaynethiessen
Copy link

shaynethiessen commented Oct 18, 2019

There is a problem with your fix. The rasterizer will no longer respect the pdf's page rotation.

            GhostscriptVersionInfo gvi = new GhostscriptVersionInfo(Loader.GetGhostScriptDLL());
            using (GhostscriptRasterizer rasterizer = new GhostscriptRasterizer())
            {
                rasterizer.Open(filePath, gvi, false);
                img = rasterizer.GetPage(96, 96, pageNumber);
            }

When converting a pdf page to an image (as shown above), it no longer keeps the rotation but instead automatically rotates it to portrait.

@shaynethiessen
Copy link

I found a fix for that. Removing the following line from viewer\FormatHandlers\GhostscriptViewerPsFormatHandler.cs fixes it.

this.Interpreter.Run(string.Format("/Orientation {0}\n", (int)this.CurrentPageOrientation));

@jhabjan jhabjan merged commit 6e084ce into ArtifexSoftware:master Feb 4, 2021
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

Successfully merging this pull request may close these issues.

3 participants