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

Android implementation for Windows.Data.Pdf #1796

Closed
wants to merge 19 commits into from

Conversation

artemious7
Copy link
Contributor

@artemious7 artemious7 commented Oct 10, 2019

GitHub Issue (If applicable): #1629

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

No implementation for Windows.Data.Pdf

What is the new behavior?

  • Added implementation for Windows.Data.Pdf for Android (where a correspondent APIs available).
  • Added extensions to convert Stream to IRandomAccessStream and vice versa (which is not a real implementation, but just a stub to pass Stream to methods accepting only IRandomAccessStream).

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
    (not sure what current supported SDKs means, but I have tested it on my Android project)
  • Docs have been added/updated which fit documentation template (for bug fixes / features)
  • Unit Tests and/or UI Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Wasm UI Tests are not showing unexpected any differences. Validate PR Screenshots Compare Test Run results.
  • Contains NO breaking changes
  • Updated the Release Notes
  • Associated with an issue (GitHub or internal)

Other information

Internal Issue (If applicable):

Copy link
Member

@jeromelaban jeromelaban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice PR, thank you for your contribution !

A few things:

@@ -0,0 +1,81 @@
#if __ANDROID__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be named ".android.cs", so that the globbing picks it up:

<None Include="**\*.Android.cs" Exclude="bin\**\*.Android.cs;obj\**\*.Android.cs" />

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I used ".Droid.cs" naming convention from here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a PR to fix the docs


namespace Windows.Data.Pdf
{
public partial class PdfDocument : IDisposable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure that the .editorconfig file is used, so that it aligns with the global whitespace configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I applied Code Cleanup, but for some reason it removes whitespace before #if conditions

pdfRenderer.Dispose();
}

private readonly PdfRenderer pdfRenderer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please place fields at the top of the file

{
throw new ArgumentNullException(nameof(options));
}
if (options.DestinationWidth > int.MaxValue)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use braces for single line conditions. (See .editorconfig file)

pdfPage.Dispose();
}

private static RectF AsAndroidRectF(Rect rect) => new RectF(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this here:

public partial struct Rect

@@ -38,6 +38,15 @@
<ItemGroup>
<UpToDateCheckInput Include="**\*.cs" Exclude="bin\**\*.cs;obj\**\*.cs;" />
</ItemGroup>

<ItemGroup>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove, caused by an android issue.

{
return wrapper.GetSourceStream();
}
else throw new ArgumentException($"stream must be a {nameof(RandomAccessStreamWrapper)}", nameof(stream));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Braces even for single line conditions

Copy link
Member

@ghuntley ghuntley Oct 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@artemious7
Copy link
Contributor Author

Fixed issues in code, but CI build still fails

@ghuntley ghuntley added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform kind/enhancement New feature or request labels Oct 14, 2019
@jeromelaban
Copy link
Member

The CI fails for a good reason now:

image

There are changes made to the classes that make for breaking changes. Ctors changes may be valid, you'd have to check in UWP to see if there are defaults ctors. For the missing extension methods, this has to be fixed.

@CLAassistant
Copy link

CLAassistant commented Jun 10, 2020

CLA assistant check
All committers have signed the CLA.

@artemious7 artemious7 requested a review from a team August 7, 2020 22:11
@MartinZikmund
Copy link
Member

@artemious7 are you able to rebase this PR to resolve the conflicts and check the build errors please?

@MartinZikmund
Copy link
Member

@artemious7 Hi, can you still get to this PR to bring it up to date please?

@MartinZikmund MartinZikmund marked this pull request as draft February 23, 2022 12:35
@artemious7
Copy link
Contributor Author

@MartinZikmund, no, sorry, I don't have the time recently and I don't use this code.

workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Sep 10, 2022
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Sep 27, 2022
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Oct 17, 2022
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Oct 18, 2022
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Oct 26, 2022
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Nov 2, 2022
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Nov 14, 2022
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Nov 30, 2022
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Dec 14, 2022
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Feb 8, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Feb 8, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Feb 8, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Feb 23, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Mar 7, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Mar 11, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Mar 14, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Mar 24, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Mar 24, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Apr 5, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Apr 14, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Apr 17, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request May 2, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request May 2, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request May 8, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Jun 30, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Jun 30, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Jul 28, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Jul 28, 2023
Inport initial implementation from PR unoplatform#1796
workgroupengineering pushed a commit to workgroupengineering/uno that referenced this pull request Jul 28, 2023
Inport initial implementation from PR unoplatform#1796
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants