├── .gitignore ├── .scripts └── deploy.sh ├── .travis.yml ├── Didstopia.PDFSharp.Tests ├── Didstopia.PDFSharp.Tests.csproj ├── FontResolver.cs ├── Fonts │ ├── Tinos-Bold.ttf │ ├── Tinos-BoldItalic.ttf │ ├── Tinos-Italic.ttf │ ├── Tinos-Licence.txt │ └── Tinos-Regular.ttf ├── ImageSource.cs ├── Images │ ├── ImageTests.cs │ ├── TestImages.cs │ ├── w3c_home.bmp │ ├── w3c_home.gif │ ├── w3c_home.jpg │ ├── w3c_home.png │ ├── w3c_home_2.bmp │ ├── w3c_home_2.gif │ ├── w3c_home_2.jpg │ ├── w3c_home_2.png │ ├── w3c_home_256.bmp │ ├── w3c_home_256.gif │ ├── w3c_home_256.jpg │ ├── w3c_home_256.png │ ├── w3c_home_animation.gif │ ├── w3c_home_animation.mng │ ├── w3c_home_gray (1).gif │ ├── w3c_home_gray (1).png │ ├── w3c_home_gray.bmp │ ├── w3c_home_gray.gif │ ├── w3c_home_gray.jpg │ └── w3c_home_gray.png ├── PDFSharpTests.cs └── Samples │ ├── pdf-example-acroform.pdf │ ├── pdf-example-password.original.pdf │ ├── pdf_sample_password.pdf │ └── sample.png ├── Didstopia.PDFSharp.sln ├── Didstopia.PDFSharp ├── !internal │ └── Configuration.cs ├── Didstopia.PDFSharp.csproj ├── Drawing.BarCodes │ ├── BarCode.cs │ ├── BarCodeRenderInfo.cs │ ├── BcgSR.cs │ ├── Code2of5Interleaved.cs │ ├── Code3of9Standard.cs │ ├── CodeBase.cs │ ├── CodeDataMatrix.cs │ ├── CodeOmr.cs │ ├── DataMatrixImage.opensource.cs │ ├── MatrixCode.cs │ ├── OmrData.cs │ ├── ThickThinBarcodeRenderer.cs │ └── enums │ │ ├── AnchorType.cs │ │ ├── CodeDirection.cs │ │ ├── CodeType.cs │ │ ├── DataMatrixEncoding.cs │ │ ├── MarkDistance.cs │ │ └── TextLocation.cs ├── Drawing.Internal │ ├── IImageImporter.cs │ ├── ImageImporter.cs │ ├── ImageImporterBmp.cs │ ├── ImageImporterJpeg.cs │ └── ImageImporterRoot.cs ├── Drawing.Layout │ ├── XTextFormatter.cs │ └── enums │ │ └── XParagraphAlignment.cs ├── Drawing.Pdf │ ├── PdfGraphicsState.cs │ ├── XGraphicsPdfRenderer.cs │ └── enums │ │ ├── DirtyFlags.cs │ │ └── StreamMode.cs ├── Drawing │ ├── CoreGraphicsPath.cs │ ├── FontFamilyCache.cs │ ├── FontFamilyInternal.cs │ ├── FontHelper.cs │ ├── GeometryHelper.cs │ ├── GraphicsStateStack.cs │ ├── IXGraphicsRenderer.cs │ ├── ImageHelper.cs │ ├── ImageSource.cs │ ├── InternalGraphicsState.cs │ ├── PdfFontOptions.cs │ ├── XBitmapDecoder.cs │ ├── XBitmapEncoder.cs │ ├── XBitmapImage.cs │ ├── XBitmapSource.cs │ ├── XBrush.cs │ ├── XBrushes.cs │ ├── XColor.cs │ ├── XColorResourceManager.cs │ ├── XColors.cs │ ├── XConvert.cs │ ├── XFont.cs │ ├── XFontFamily.cs │ ├── XFontMetrics.cs │ ├── XFontSource.cs │ ├── XFontStretch.cs │ ├── XFontWeight.cs │ ├── XFontWeights.cs │ ├── XForm.cs │ ├── XGlyphTypeface.cs │ ├── XGraphics.cs │ ├── XGraphicsContainer.cs │ ├── XGraphicsPath.cs │ ├── XGraphicsPathInternals.cs │ ├── XGraphicsPathItem.cs │ ├── XGraphicsState.cs │ ├── XImage.cs │ ├── XImageFormat.cs │ ├── XKnownColorTable.cs │ ├── XLinearGradientBrush.cs │ ├── XMatrix.cs │ ├── XPdfForm.cs │ ├── XPen.cs │ ├── XPens.cs │ ├── XPoint.cs │ ├── XPrivateFontCollection.cs │ ├── XRect.cs │ ├── XSize.cs │ ├── XSolidBrush.cs │ ├── XStringFormat.cs │ ├── XStringFormats.cs │ ├── XTypeface.cs │ ├── XUnit.cs │ ├── XVector.cs │ └── enums │ │ ├── PathStart.cs │ │ ├── XColorSpace.cs │ │ ├── XCombineMode.cs │ │ ├── XDashStyle.cs │ │ ├── XFillMode.cs │ │ ├── XFontStyle.cs │ │ ├── XGdiFontStyle.cs │ │ ├── XGraphicRenderTarget.cs │ │ ├── XGraphicsPathItemType.cs │ │ ├── XGraphicsPdfPageOptions.cs │ │ ├── XGraphicsUnit.cs │ │ ├── XKnownColor.cs │ │ ├── XLineAlignment.cs │ │ ├── XLineCap.cs │ │ ├── XLineJoin.cs │ │ ├── XLinearGradientMode.cs │ │ ├── XMatrixOrder.cs │ │ ├── XPageDirection.cs │ │ ├── XSmoothingMode.cs │ │ ├── XStringAlignment.cs │ │ ├── XStyleSimulations.cs │ │ └── XSweepDirection.cs ├── Fonts.OpenType │ ├── FontDescriptor.cs │ ├── GenericFontTable.cs │ ├── GlyphDataTable.cs │ ├── GlyphTypefaceCache.cs │ ├── IRefFontTable.cs │ ├── IndexToLocationTable.cs │ ├── OpenTypeDescriptor.cs │ ├── OpenTypeFontTable.cs │ ├── OpenTypeFontTables.cs │ ├── OpenTypeFontWriter.cs │ ├── OpenTypeFontface.cs │ ├── OpenTypeFontfaceCache.cs │ ├── TableDirectoryEntry.cs │ └── enums │ │ ├── FontTechnology.cs │ │ └── TableTagNames.cs ├── Fonts │ ├── AdobeGlyphList20.cs │ ├── CMapInfo.cs │ ├── FontDescriptorCache.cs │ ├── FontFactory.cs │ ├── FontResolverInfo.cs │ ├── FontResolvingOptions.cs │ ├── FontWriter.cs │ ├── GlobalFontSettings.cs │ ├── IFontResolver.cs │ ├── PlatformFontResolver.cs │ └── PlatformFontResolverInfo.cs ├── Internal │ ├── Calc.cs │ ├── ColorHelper.cs │ ├── Diagnostics.cs │ ├── DiagnosticsHelper.cs │ ├── DoubleUtil.cs │ ├── Lock.cs │ ├── NativeMethods.cs │ └── TokenizerHelper.cs ├── Pdf.AcroForms │ ├── PdfAcroField.cs │ ├── PdfAcroForm.cs │ ├── PdfButtonField.cs │ ├── PdfCheckBoxField.cs │ ├── PdfChoiceField.cs │ ├── PdfComboBoxField.cs │ ├── PdfGenericField.cs │ ├── PdfListBoxField.cs │ ├── PdfPushButtonField.cs │ ├── PdfRadioButtonField.cs │ ├── PdfSignatureField.cs │ ├── PdfTextField.cs │ └── enums │ │ └── PdfAcroFieldFlags.cs ├── Pdf.Actions │ ├── PdfAction.cs │ ├── PdfGoToAction.cs │ └── enums │ │ └── PdfNamedActionNames.cs ├── Pdf.Advanced │ ├── IContentStream.cs │ ├── PdfCIDFont.cs │ ├── PdfCatalog.cs │ ├── PdfContent.cs │ ├── PdfContents.cs │ ├── PdfCrossReferenceStream.cs │ ├── PdfCrossReferenceTable.cs │ ├── PdfDictionaryWithContentStream.cs │ ├── PdfExtGState.cs │ ├── PdfExtGStateTable.cs │ ├── PdfFont.cs │ ├── PdfFontDescriptor.cs │ ├── PdfFontTable.cs │ ├── PdfFormXObject.cs │ ├── PdfFormXObjectTable.cs │ ├── PdfGroupAttributes.cs │ ├── PdfImage.FaxEncode.cs │ ├── PdfImage.cs │ ├── PdfImageTable.cs │ ├── PdfImportedObjectTable.cs │ ├── PdfInternals.cs │ ├── PdfObjectInternals.cs │ ├── PdfObjectStream.cs │ ├── PdfPageInheritableObjects.cs │ ├── PdfPageInterals.cs │ ├── PdfReference.cs │ ├── PdfResourceMap.cs │ ├── PdfResourceTable.cs │ ├── PdfResources.cs │ ├── PdfShading.cs │ ├── PdfShadingPattern.cs │ ├── PdfSoftMask.cs │ ├── PdfTilingPattern.cs │ ├── PdfToUnicodeMap.cs │ ├── PdfTrailer.cs │ ├── PdfTransparencyGroupAttributes.cs │ ├── PdfTrueTypeFont.cs │ ├── PdfType0Font.cs │ ├── PdfType1Font.cs │ └── PdfXObject.cs ├── Pdf.Annotations │ ├── PdfAnnotation.cs │ ├── PdfAnnotations.cs │ ├── PdfGenericAnnotation.cs │ ├── PdfLinkAnnotation.cs │ ├── PdfRubberStampAnnotation.cs │ ├── PdfTextAnnotation.cs │ ├── PdfWidgetAnnotation.cs │ └── enums │ │ ├── PdfAnnotationFlags.cs │ │ ├── PdfRubberStampAnnotationIcon.cs │ │ └── PdfTextAnnotationIcon.cs ├── Pdf.Content.Objects │ ├── CObjects.cs │ ├── Operators.cs │ └── enum │ │ ├── OpCodeFlags.cs │ │ └── OpCodeName.cs ├── Pdf.Content │ ├── CLexer.cs │ ├── CParser.cs │ ├── Chars.cs │ ├── ContentReader.cs │ ├── ContentReaderException.cs │ ├── ContentWriter.cs │ └── enums │ │ └── Symbol.cs ├── Pdf.Filters │ ├── Ascii85Decode.cs │ ├── AsciiHexDecode.cs │ ├── Filter.cs │ ├── Filtering.cs │ ├── FlateDecode.cs │ └── LzwDecode.cs ├── Pdf.IO │ ├── Chars.cs │ ├── Lexer.cs │ ├── Parser.cs │ ├── PdfReader.cs │ ├── PdfReaderException.cs │ ├── PdfWriter.cs │ ├── ShiftStack.cs │ └── enums │ │ ├── PasswordValidity.cs │ │ ├── PdfDocumentOpenMode.cs │ │ ├── PdfWriterLayout.cs │ │ ├── PdfWriterOptions.cs │ │ └── Symbol.cs ├── Pdf.Internal │ ├── AnsiEncoding.cs │ ├── ColorSpaceHelper.cs │ ├── DocEncoding.cs │ ├── GlobalObjectTable.cs │ ├── PdfDiagnostics.cs │ ├── PdfEncoders.cs │ ├── RawEncoding.cs │ ├── RawUnicodeEncoding.cs │ └── ThreadLocalStorage.cs ├── Pdf.Printing │ └── PdfFilePrinter.cs ├── Pdf.Security │ ├── PdfSecurityHandler.cs │ ├── PdfSecuritySettings.cs │ ├── PdfStandardSecurityHandler.cs │ └── enums │ │ ├── PdfDocumentSecurity.cs │ │ └── PdfUserAccessPermission.cs ├── Pdf │ ├── EntryInfoAttribute.cs │ ├── KeysBase.cs │ ├── KeysMeta.cs │ ├── PdfArray.cs │ ├── PdfBoolean.cs │ ├── PdfBooleanObject.cs │ ├── PdfCustomValue.cs │ ├── PdfCustomValues.cs │ ├── PdfDate.cs │ ├── PdfDictionary.cs │ ├── PdfDocument.cs │ ├── PdfDocumentInformation.cs │ ├── PdfDocumentOptions.cs │ ├── PdfDocumentSettings.cs │ ├── PdfInteger.cs │ ├── PdfIntegerObject.cs │ ├── PdfItem.cs │ ├── PdfLiteral.cs │ ├── PdfName.cs │ ├── PdfNameObject.cs │ ├── PdfNull.cs │ ├── PdfNullObject.cs │ ├── PdfNumber.cs │ ├── PdfNumberObject.cs │ ├── PdfObject.cs │ ├── PdfObjectID.cs │ ├── PdfOutline.cs │ ├── PdfOutlineCollection.cs │ ├── PdfPage.cs │ ├── PdfPages.cs │ ├── PdfReal.cs │ ├── PdfRealObject.cs │ ├── PdfRectangle.cs │ ├── PdfReferenceTable.cs │ ├── PdfString.cs │ ├── PdfStringObject.cs │ ├── PdfUInteger.cs │ ├── PdfUIntegerObject.cs │ ├── PdfViewerPreferences.cs │ ├── TrimMargins.cs │ └── enums │ │ ├── DocumentState.cs │ │ ├── PdfColorMode.cs │ │ ├── PdfCustomValueCompression.cs │ │ ├── PdfFlateEncodeMode.cs │ │ ├── PdfFontEncoding.cs │ │ ├── PdfOutlineStyle.cs │ │ ├── PdfPageDestinationType.cs │ │ ├── PdfPageLayout.cs │ │ ├── PdfPageMode.cs │ │ ├── PdfReadingDirection.cs │ │ ├── PdfTextStringEncoding.cs │ │ └── PdfUseFlateDecoderForJpegImages.cs ├── SharpZipLib │ ├── Checksums │ │ ├── Adler32.cs │ │ ├── CRC32.cs │ │ └── IChecksum.cs │ ├── ReadMe.txt │ ├── SharpZipBaseException.cs │ └── Zip │ │ ├── Compression │ │ ├── Deflater.cs │ │ ├── DeflaterConstants.cs │ │ ├── DeflaterEngine.cs │ │ ├── DeflaterHuffman.cs │ │ ├── DeflaterPending.cs │ │ ├── Inflater.cs │ │ ├── InflaterDynHeader.cs │ │ ├── InflaterHuffmanTree.cs │ │ ├── PendingBuffer.cs │ │ └── Streams │ │ │ ├── DeflaterOutputStream.cs │ │ │ ├── InflaterInputStream.cs │ │ │ ├── OutputWindow.cs │ │ │ └── StreamManipulator.cs │ │ ├── ZipConstants.cs │ │ └── ZipException.cs ├── SilverlightInternals │ └── AgHacks.cs └── root │ ├── PSSR.cs │ ├── PageSizeConverter.cs │ ├── PdfSharpException.cs │ ├── ProductVersionInfo.cs │ ├── VersionInfo.cs │ └── enums │ ├── PSMsgID.cs │ ├── PageOrientation.cs │ └── PageSize.cs ├── LICENSE.md └── README.md /.scripts/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -o pipefail 5 | 6 | BUILD_CONFIG=$1 7 | NUGET_API_KEY=$2 8 | NUGET_SOURCE_URL=${3:-https://www.nuget.org/api/v2/package} 9 | TRAVIS_TAG=$4 10 | 11 | if [[ "$BUILD_CONFIG" == "Release" ]]; then 12 | 13 | if [ $# -eq 3 ]; then 14 | VERSION_SUFFIX="SNAPSHOT-$(git rev-list HEAD | wc -l)-$(git rev-parse --short HEAD)" 15 | dotnet restore /p:VersionSuffix=$VERSION_SUFFIX 16 | dotnet build -c ${BUILD_CONFIG} /p:VersionSuffix=$VERSION_SUFFIX 17 | dotnet pack -c ${BUILD_CONFIG} --no-build --version-suffix $VERSION_SUFFIX 18 | else 19 | dotnet restore /p:PackageVersion=${TRAVIS_TAG#v} 20 | dotnet build -c ${BUILD_CONFIG} /p:PackageVersion=${TRAVIS_TAG#v} 21 | dotnet pack -c ${BUILD_CONFIG} --no-build /p:PackageVersion=${TRAVIS_TAG#v} 22 | fi 23 | 24 | dotnet nuget push Didstopia.PDFSharp/bin/$BUILD_CONFIG/*.nupkg --api-key $NUGET_API_KEY --source $NUGET_SOURCE_URL || true 25 | fi 26 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Main language/toolchain 2 | language: csharp 3 | 4 | # Mono is not required for this project 5 | mono: none 6 | 7 | # Install .NET Core 2.1 8 | dotnet: 2.1 9 | 10 | # Run Ubuntu Trusty 11 | dist: trusty 12 | 13 | # Disable sudo to enable running inside a container 14 | sudo: false 15 | 16 | # Skip the installation step 17 | install: true 18 | 19 | ## NOTE: Conditionals are broken with tagged releases: 20 | ## https://github.com/Didstopia/PDFSharp/issues/34 21 | 22 | # Additional jobs that run after tests 23 | jobs: 24 | fast_finish: true 25 | include: 26 | 27 | - stage: Build and Test 28 | script: 29 | - dotnet restore 30 | - dotnet build -c ${BUILD_CONFIG} 31 | - dotnet test -c ${BUILD_CONFIG} --no-build Didstopia.PDFSharp.Tests 32 | - dotnet pack -c ${BUILD_CONFIG} --no-build 33 | 34 | - stage: Deploy to MyGet 35 | #if: (branch = development) AND (type != pull_request) 36 | script: skip 37 | deploy: 38 | provider: script 39 | script: .scripts/deploy.sh $BUILD_CONFIG $MYGET_API_KEY $MYGET_FEED 40 | skip_cleanup: true 41 | on: 42 | repo: Didstopia/PDFSharp 43 | branch: development 44 | tags: false 45 | 46 | - stage: Deploy to NuGet 47 | #if: branch = master 48 | script: skip 49 | deploy: 50 | provider: script 51 | script: 52 | - if [ ! -z "$TRAVIS_TAG" ]; then .scripts/deploy.sh $BUILD_CONFIG $NUGET_API_KEY "" $TRAVIS_TAG; else echo "Missing tag, skipping NuGet deployment.."; fi 53 | skip_cleanup: true 54 | on: 55 | repo: Didstopia/PDFSharp 56 | branch: master 57 | tags: false 58 | 59 | - stage: Deploy to GitHub 60 | #if: branch = master 61 | script: 62 | - if [ ! -z "$TRAVIS_TAG" ]; then dotnet restore /p:PackageVersion=${TRAVIS_TAG#v}; else echo "Missing tag, skipping restore.."; fi 63 | - if [ ! -z "$TRAVIS_TAG" ]; then dotnet build -c $BUILD_CONFIG /p:PackageVersion=${TRAVIS_TAG#v}; else echo "Missing tag, skipping build.."; fi 64 | - if [ ! -z "$TRAVIS_TAG" ]; then dotnet pack -c $BUILD_CONFIG --no-build /p:PackageVersion=${TRAVIS_TAG#v}; else echo "Missing tag, skipping pack.."; fi 65 | deploy: 66 | provider: releases 67 | api_key: $GITHUB_OAUTH_TOKEN 68 | file_glob: true 69 | file: "Didstopia.PDFSharp/bin/${BUILD_CONFIG}/*.nupkg" 70 | skip_cleanup: true 71 | on: 72 | repo: Didstopia/PDFSharp 73 | branch: master 74 | tags: true 75 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/FontResolver.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Linq; 4 | using System.Reflection; 5 | using Didstopia.PDFSharp.Fonts; 6 | 7 | namespace Didstopia.PDFSharp.Tests 8 | { 9 | public class FontResolver : IFontResolver 10 | { 11 | public string DefaultFontName => "Tinos"; 12 | 13 | public byte[] GetFont(string faceName) 14 | { 15 | using (var ms = new MemoryStream()) 16 | { 17 | var assembly = typeof(FontResolver).GetTypeInfo().Assembly; 18 | var resources = assembly.GetManifestResourceNames(); 19 | var resourceName = resources.First(x => x == faceName); 20 | using (var rs = assembly.GetManifestResourceStream(resourceName)) 21 | { 22 | rs.CopyTo(ms); 23 | ms.Position = 0; 24 | return ms.ToArray(); 25 | } 26 | } 27 | } 28 | 29 | public FontResolverInfo ResolveTypeface(string familyName, bool isBold, bool isItalic) 30 | { 31 | if (familyName.Equals("Tinos", StringComparison.CurrentCultureIgnoreCase)) 32 | { 33 | if (isBold && isItalic) 34 | { 35 | return new FontResolverInfo("Tinos-BoldItalic.ttf"); 36 | } 37 | else if (isBold) 38 | { 39 | return new FontResolverInfo("Tinos-Bold.ttf"); 40 | } 41 | else if (isItalic) 42 | { 43 | return new FontResolverInfo("Tinos-Italic.ttf"); 44 | } 45 | else 46 | { 47 | return new FontResolverInfo("Tinos-Regular.ttf"); 48 | } 49 | } 50 | return null; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Fonts/Tinos-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Fonts/Tinos-Bold.ttf -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Fonts/Tinos-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Fonts/Tinos-BoldItalic.ttf -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Fonts/Tinos-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Fonts/Tinos-Italic.ttf -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Fonts/Tinos-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Fonts/Tinos-Regular.ttf -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/ImageTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Didstopia.PDFSharp.Drawing; 7 | using Xunit; 8 | 9 | namespace Didstopia.PDFSharp.Tests.Images 10 | { 11 | public class ImageTests 12 | { 13 | private TestImages images = new TestImages(); 14 | [Fact()] 15 | public void IsJpg_ShouldReturnTrue() 16 | { 17 | Assert.True(XImage.IsImageJpg(images.W3CJpg)); 18 | Assert.True(XImage.IsImageJpg(images.W3C2Jpg)); 19 | Assert.True(XImage.IsImageJpg(images.W3C256Jpg)); 20 | Assert.True(XImage.IsImageJpg(images.W3CGrayJpg)); 21 | 22 | } 23 | [Fact()] 24 | public void IsNotJpg_ShouldReturnFalse() 25 | { 26 | Assert.False(XImage.IsImageJpg(images.W3CBmp)); 27 | Assert.False(XImage.IsImageJpg(images.W3CGif)); 28 | Assert.False(XImage.IsImageJpg(images.W3CPng)); 29 | Assert.False(XImage.IsImageJpg(images.W3C2Bmp)); 30 | Assert.False(XImage.IsImageJpg(images.W3C2Gif)); 31 | Assert.False(XImage.IsImageJpg(images.W3C2Png)); 32 | Assert.False(XImage.IsImageJpg(images.W3C256Bmp)); 33 | Assert.False(XImage.IsImageJpg(images.W3C256Gif)); 34 | Assert.False(XImage.IsImageJpg(images.W3C256Png)); 35 | Assert.False(XImage.IsImageJpg(images.W3CAnimationGif)); 36 | Assert.False(XImage.IsImageJpg(images.W3CAnimationMng)); 37 | Assert.False(XImage.IsImageJpg(images.W3CGrayBmp)); 38 | Assert.False(XImage.IsImageJpg(images.W3CGrayGif)); 39 | Assert.False(XImage.IsImageJpg(images.W3CGrayPng)); 40 | 41 | } 42 | } 43 | } 44 | 45 | 46 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/TestImages.cs: -------------------------------------------------------------------------------- 1 | //All Images Courtesy of WikiMedia 2 | namespace Didstopia.PDFSharp.Tests.Images 3 | { 4 | public class TestImages 5 | { 6 | public TestImages() 7 | { 8 | this.W3CBmp = getImage("w3c_home.bmp"); 9 | this.W3CGif = getImage("w3c_home.gif"); 10 | this.W3CJpg = getImage("w3c_home.jpg"); 11 | this.W3CPng = getImage("w3c_home.png"); 12 | this.W3C2Bmp = getImage("w3c_home_2.bmp"); 13 | this.W3C2Gif = getImage("w3c_home_2.gif"); 14 | this.W3C2Jpg = getImage("w3c_home_2.jpg"); 15 | this.W3C2Png = getImage("w3c_home_2.png"); 16 | this.W3C256Bmp = getImage("w3c_home_256.bmp"); 17 | this.W3C256Gif = getImage("w3c_home_256.gif"); 18 | this.W3C256Jpg = getImage("w3c_home_256.jpg"); 19 | this.W3C256Png = getImage("w3c_home_256.png"); 20 | this.W3CAnimationGif = getImage("w3c_home_animation.gif"); 21 | this.W3CAnimationMng = getImage("w3c_home_animation.mng"); 22 | this.W3CGrayBmp = getImage("w3c_home_gray.bmp"); 23 | this.W3CGrayGif = getImage("w3c_home_gray.gif"); 24 | this.W3CGrayJpg = getImage("w3c_home_gray.jpg"); 25 | this.W3CGrayPng = getImage("w3c_home_gray.png"); 26 | } 27 | 28 | public byte[] W3CBmp { get; } 29 | public byte[] W3CGif { get; } 30 | public byte[] W3CJpg { get; } 31 | public byte[] W3CPng { get; } 32 | public byte[] W3C2Bmp { get; } 33 | public byte[] W3C2Gif { get; } 34 | public byte[] W3C2Jpg { get; } 35 | public byte[] W3C2Png { get; } 36 | public byte[] W3C256Bmp { get; } 37 | public byte[] W3C256Gif { get; } 38 | public byte[] W3C256Jpg { get; } 39 | public byte[] W3C256Png { get; } 40 | public byte[] W3CAnimationGif { get; } 41 | public byte[] W3CAnimationMng { get; } 42 | public byte[] W3CGrayBmp { get; } 43 | public byte[] W3CGrayGif { get; } 44 | public byte[] W3CGrayJpg { get; } 45 | public byte[] W3CGrayPng { get; } 46 | 47 | private byte[] getImage(string imageName) 48 | { 49 | imageName = $"Didstopia.PDFSharp.Tests.Images.{imageName}"; 50 | var assembly = typeof(TestImages).Assembly; 51 | using (var resFilestream = assembly.GetManifestResourceStream(imageName)) 52 | { 53 | if (resFilestream == null) return null; 54 | byte[] bytes = new byte[resFilestream.Length]; 55 | resFilestream.Read(bytes, 0, bytes.Length); 56 | return bytes; 57 | } 58 | } 59 | } 60 | } 61 | 62 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home.bmp -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home.gif -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home.jpg -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home.png -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_2.bmp -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_2.gif -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_2.jpg -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_2.png -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_256.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_256.bmp -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_256.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_256.gif -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_256.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_256.jpg -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_256.png -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_animation.gif -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_animation.mng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_animation.mng -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_gray (1).gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_gray (1).gif -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_gray (1).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_gray (1).png -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_gray.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_gray.bmp -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_gray.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_gray.gif -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_gray.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_gray.jpg -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Images/w3c_home_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Images/w3c_home_gray.png -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Samples/pdf-example-acroform.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Samples/pdf-example-acroform.pdf -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Samples/pdf-example-password.original.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Samples/pdf-example-password.original.pdf -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Samples/pdf_sample_password.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Samples/pdf_sample_password.pdf -------------------------------------------------------------------------------- /Didstopia.PDFSharp.Tests/Samples/sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp.Tests/Samples/sample.png -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing.BarCodes/BarCodeRenderInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PDFsharp - A library for processing PDF 3 | // 4 | // Authors: 5 | // Klaus Potzesny 6 | // 7 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 8 | // 9 | // http://www.PdfSharpCore.com 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining 12 | // a copy of this software and associated documentation files (the 13 | // "Software"), to deal in the Software without restriction, including 14 | // without limitation the rights to use, copy, modify, merge, publish, 15 | // distribute, sublicense, and/or sell copies of the Software, and to 16 | // permit persons to whom the Software is furnished to do so, subject to 17 | // the following conditions: 18 | // 19 | // The above copyright notice and this permission notice shall be 20 | // included in all copies or substantial portions of the Software. 21 | // 22 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 23 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 24 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 25 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 27 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 28 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 29 | 30 | namespace Didstopia.PDFSharp.Drawing.BarCodes 31 | { 32 | /// 33 | /// Holds all temporary information needed during rendering. 34 | /// 35 | class BarCodeRenderInfo 36 | { 37 | public BarCodeRenderInfo(XGraphics gfx, XBrush brush, XFont font, XPoint position) 38 | { 39 | Gfx = gfx; 40 | Brush = brush; 41 | Font = font; 42 | Position = position; 43 | } 44 | 45 | public XGraphics Gfx; 46 | public XBrush Brush; 47 | public XFont Font; 48 | public XPoint Position; 49 | public double BarHeight; 50 | public XPoint CurrPos; 51 | public int CurrPosInString; 52 | public double ThinBarWidth; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing.BarCodes/enums/CodeDirection.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Drawing.BarCodes/enums/CodeDirection.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing.BarCodes/enums/CodeType.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Klaus Potzesny 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing.BarCodes 31 | { 32 | /// 33 | /// Specifies the type of the bar code. 34 | /// 35 | public enum CodeType 36 | { 37 | /// 38 | /// The standard 2 of 5 interleaved bar code. 39 | /// 40 | // ReSharper disable once InconsistentNaming 41 | Code2of5Interleaved, 42 | 43 | /// 44 | /// The standard 3 of 9 bar code. 45 | /// 46 | // ReSharper disable once InconsistentNaming 47 | Code3of9Standard, 48 | 49 | /// 50 | /// The OMR code. 51 | /// 52 | Omr, 53 | 54 | /// 55 | /// The data matrix code. 56 | /// 57 | DataMatrix, 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing.BarCodes/enums/DataMatrixEncoding.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Klaus Potzesny 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing.BarCodes 31 | { 32 | /// 33 | /// docDaSt 34 | /// 35 | public enum DataMatrixEncoding 36 | { 37 | /// 38 | /// docDaSt 39 | /// 40 | Ascii, 41 | 42 | /// 43 | /// docDaSt 44 | /// 45 | C40, 46 | 47 | /// 48 | /// docDaSt 49 | /// 50 | Text, 51 | 52 | /// 53 | /// docDaSt 54 | /// 55 | X12, 56 | 57 | /// 58 | /// docDaSt 59 | /// 60 | // ReSharper disable once InconsistentNaming 61 | EDIFACT, 62 | 63 | /// 64 | /// docDaSt 65 | /// 66 | Base256 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing.BarCodes/enums/MarkDistance.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Klaus Potzesny 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing.BarCodes 31 | { 32 | ///// 33 | ///// Valid mark distances for OMR Codes. 34 | ///// 35 | //public enum MarkDistance 36 | //{ 37 | // /// 38 | // /// 2/6 inch, valid for printing with 6 lpi. (line height = 12 pt). 39 | // /// 40 | // Inch1_6, 41 | // /// 42 | // /// 2/6 inch, valid for printing with 6 lpi (line height = 12 pt). 43 | // /// 44 | // Inch2_6, 45 | // /// 46 | // /// 2/8 inch, valid for printing with 8 lpi (line height = 9 pt). 47 | // /// 48 | // Inch2_8 49 | //} 50 | } -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing.BarCodes/enums/TextLocation.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Klaus Potzesny 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing.BarCodes 31 | { 32 | /// 33 | /// Specifies whether and how the text is displayed at the code. 34 | /// 35 | public enum TextLocation 36 | { 37 | /// 38 | /// No text is drawn. 39 | /// 40 | None, 41 | 42 | /// 43 | /// The text is located above the code. 44 | /// 45 | Above, 46 | 47 | /// 48 | /// The text is located below the code. 49 | /// 50 | Below, 51 | 52 | 53 | /// 54 | /// The text is located above within the code. 55 | /// 56 | AboveEmbedded, 57 | 58 | 59 | /// 60 | /// The text is located below within the code. 61 | /// 62 | BelowEmbedded, 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing.Internal/ImageImporterRoot.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Thomas Hövel 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing.Internal 31 | { 32 | internal abstract class ImageImporterRoot 33 | { 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing.Layout/XTextFormatter.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Drawing.Layout/XTextFormatter.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing.Layout/enums/XParagraphAlignment.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing.Layout 31 | { 32 | /// 33 | /// Specifies the alignment of a paragraph. 34 | /// 35 | public enum XParagraphAlignment 36 | { 37 | /// 38 | /// Default alignment, typically left alignment. 39 | /// 40 | Default, 41 | 42 | /// 43 | /// The paragraph is rendered left aligned. 44 | /// 45 | Left, 46 | 47 | /// 48 | /// The paragraph is rendered centered. 49 | /// 50 | Center, 51 | 52 | /// 53 | /// The paragraph is rendered right aligned. 54 | /// 55 | Right, 56 | 57 | /// 58 | /// The paragraph is rendered justified. 59 | /// 60 | Justify, 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing.Pdf/PdfGraphicsState.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Drawing.Pdf/PdfGraphicsState.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing.Pdf/enums/DirtyFlags.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Drawing.Pdf 33 | { 34 | [Flags] 35 | enum DirtyFlags 36 | { 37 | Ctm = 0x00000001, 38 | ClipPath = 0x00000002, 39 | LineWidth = 0x00000010, 40 | LineJoin = 0x00000020, 41 | MiterLimit = 0x00000040, 42 | StrokeFill = 0x00000070, 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing.Pdf/enums/StreamMode.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing.Pdf 31 | { 32 | /// 33 | /// Indicates whether we are within a BT/ET block. 34 | /// 35 | enum StreamMode 36 | { 37 | /// 38 | /// Graphic mode. This is default. 39 | /// 40 | Graphic, 41 | 42 | /// 43 | /// Text mode. 44 | /// 45 | Text, 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/IXGraphicsRenderer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Drawing/IXGraphicsRenderer.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/ImageSource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | 7 | namespace MigraDocCore.DocumentObjectModel.MigraDoc.DocumentObjectModel.Shapes 8 | { 9 | public abstract class ImageSource 10 | { 11 | public static ImageSource ImageSourceImpl { get; set; } 12 | 13 | public interface IImageSource 14 | { 15 | int Width { get; } 16 | int Height { get; } 17 | string Name { get; } 18 | bool IsJpeg { get; } 19 | void SaveAsJpeg(MemoryStream ms); 20 | void SaveAsBmp(MemoryStream ms); 21 | } 22 | 23 | protected abstract IImageSource FromFileImpl(string path, bool isJpeg = true, int? quality = 75); 24 | protected abstract IImageSource FromBinaryImpl(string name, Func imageSource, bool isJpeg = true, int? quality = 75); 25 | protected abstract IImageSource FromStreamImpl(string name, Func imageStream, bool isJpeg = true, int? quality = 75); 26 | 27 | public static IImageSource FromFile(string path, bool isJpeg = true, int? quality = 75) 28 | { 29 | try { return ImageSourceImpl.FromFileImpl(path, isJpeg, quality); } 30 | catch (Exception) { throw new Exception("Invalid or missing ImageSource implementation (a custom implementation is required)"); } 31 | } 32 | 33 | public static IImageSource FromBinary(string name, Func imageSource, bool isJpeg = true, int? quality = 75) 34 | { 35 | try { return ImageSourceImpl.FromBinaryImpl(name, imageSource, isJpeg, quality); } 36 | catch (Exception) { throw new Exception("Invalid or missing ImageSource implementation (a custom implementation is required)"); } 37 | } 38 | 39 | public static IImageSource FromStream(string name, Func imageStream, bool isJpeg = true, int? quality = 75) 40 | { 41 | try { return ImageSourceImpl.FromStreamImpl(name, imageStream, isJpeg, quality); } 42 | catch (Exception) { throw new Exception("Invalid or missing ImageSource implementation (a custom implementation is required)"); } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/XBitmapDecoder.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | #if CORE 31 | #endif 32 | #if GDI 33 | using System.Drawing; 34 | using System.Drawing.Drawing2D; 35 | using System.Drawing.Imaging; 36 | #endif 37 | #if WPF 38 | using System.Windows; 39 | using System.Windows.Media; 40 | using System.Windows.Media.Imaging; 41 | #endif 42 | #if NETFX_CORE 43 | using Windows.UI.Xaml.Media.Imaging; 44 | #endif 45 | 46 | namespace Didstopia.PDFSharp.Drawing 47 | { 48 | /// 49 | /// Provides functionality to load a bitmap image encoded in a specific format. 50 | /// 51 | public class XBitmapDecoder 52 | { 53 | internal XBitmapDecoder() 54 | { } 55 | 56 | /// 57 | /// Gets a new instance of the PNG image decoder. 58 | /// 59 | public static XBitmapDecoder GetPngDecoder() 60 | { 61 | return new XPngBitmapDecoder(); 62 | } 63 | } 64 | 65 | internal sealed class XPngBitmapDecoder : XBitmapDecoder 66 | { 67 | internal XPngBitmapDecoder() 68 | { } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/XFontStretch.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | #if PDFSHARP20 33 | enum FontStretchValues 34 | { 35 | UltraCondensed = 1, 36 | ExtraCondensed = 2, 37 | Condensed = 3, 38 | SemiCondensed = 4, 39 | Normal = 5, 40 | SemiExpanded = 6, 41 | Expanded = 7, 42 | ExtraExpanded = 8, 43 | UltraExpanded = 9, 44 | } 45 | 46 | /// 47 | /// NYI. Reserved for future extensions of PdfSharpCore. 48 | /// 49 | // [DebuggerDisplay("'{Name}', {Size}")] 50 | public class XFontStretch 51 | { } 52 | #endif 53 | } 54 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/XGraphics.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Drawing/XGraphics.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/XGraphicsContainer.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | #if GDI 31 | using System.Drawing; 32 | using System.Drawing.Drawing2D; 33 | #endif 34 | #if WPF 35 | using System.Windows.Media; 36 | #endif 37 | 38 | namespace Didstopia.PDFSharp.Drawing 39 | { 40 | /// 41 | /// Represents the internal state of an XGraphics object. 42 | /// 43 | public sealed class XGraphicsContainer 44 | { 45 | #if GDI 46 | internal XGraphicsContainer(GraphicsState state) 47 | { 48 | GdiState = state; 49 | } 50 | internal GraphicsState GdiState; 51 | #endif 52 | #if WPF 53 | internal XGraphicsContainer() 54 | { } 55 | #endif 56 | internal InternalGraphicsState InternalState; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/XGraphicsPath.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Drawing/XGraphicsPath.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/XGraphicsPathInternals.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | #if GDI 31 | using System.Drawing; 32 | using System.Drawing.Drawing2D; 33 | #endif 34 | #if WPF 35 | using System.Windows; 36 | using System.Windows.Media; 37 | #endif 38 | #if NETFX_CORE 39 | using Windows.UI.Xaml.Media; 40 | #endif 41 | 42 | namespace Didstopia.PDFSharp.Drawing 43 | { 44 | /// 45 | /// Provides access to the internal data structures of XGraphicsPath. 46 | /// This class prevents the public interface from pollution with internal functions. 47 | /// 48 | public sealed class XGraphicsPathInternals 49 | { 50 | internal XGraphicsPathInternals(XGraphicsPath path) 51 | { 52 | _path = path; 53 | } 54 | XGraphicsPath _path; 55 | 56 | #if GDI 57 | /// 58 | /// Gets the underlying GDI+ path object. 59 | /// 60 | public GraphicsPath GdiPath 61 | { 62 | get { return _path._gdipPath; } 63 | } 64 | #endif 65 | 66 | #if WPF || NETFX_CORE 67 | /// 68 | /// Gets the underlying WPF path geometry object. 69 | /// 70 | public PathGeometry WpfPath 71 | { 72 | get { return _path._pathGeometry; } 73 | } 74 | #endif 75 | } 76 | } -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/XGraphicsState.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | #if GDI 31 | using System.Drawing; 32 | using System.Drawing.Drawing2D; 33 | #endif 34 | #if WPF 35 | using System.Windows.Media; 36 | #endif 37 | 38 | namespace Didstopia.PDFSharp.Drawing 39 | { 40 | /// 41 | /// Represents the internal state of an XGraphics object. 42 | /// This class is used as a handle for restoring the context. 43 | /// 44 | public sealed class XGraphicsState 45 | { 46 | // This class is simply a wrapper of InternalGraphicsState. 47 | #if CORE 48 | internal XGraphicsState() 49 | { } 50 | #endif 51 | #if GDI 52 | internal XGraphicsState(GraphicsState state) 53 | { 54 | GdiState = state; 55 | } 56 | 57 | internal GraphicsState GdiState; 58 | #endif 59 | #if WPF 60 | internal XGraphicsState() 61 | { } 62 | #endif 63 | internal InternalGraphicsState InternalState; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/PathStart.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | // ReSharper disable InconsistentNaming 31 | 32 | namespace Didstopia.PDFSharp.Drawing 33 | { 34 | /// 35 | /// Indicates how to handle the first point of a path. 36 | /// 37 | internal enum PathStart 38 | { 39 | /// 40 | /// Set the current position to the first point. 41 | /// 42 | MoveTo1st, 43 | 44 | /// 45 | /// Draws a line to the first point. 46 | /// 47 | LineTo1st, 48 | 49 | /// 50 | /// Ignores the first point. 51 | /// 52 | Ignore1st, 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XColorSpace.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Currently not used. Only DeviceRGB is rendered in PDF. 34 | /// 35 | public enum XColorSpace 36 | { 37 | /// 38 | /// Identifies the RGB color space. 39 | /// 40 | Rgb, 41 | 42 | /// 43 | /// Identifies the CMYK color space. 44 | /// 45 | Cmyk, 46 | 47 | /// 48 | /// Identifies the gray scale color space. 49 | /// 50 | GrayScale, 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XCombineMode.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Specifies how different clipping regions can be combined. 34 | /// 35 | public enum XCombineMode // Same values as System.Drawing.Drawing2D.CombineMode. 36 | { 37 | /// 38 | /// One clipping region is replaced by another. 39 | /// 40 | Replace = 0, 41 | 42 | /// 43 | /// Two clipping regions are combined by taking their intersection. 44 | /// 45 | Intersect = 1, 46 | 47 | /// 48 | /// Not yet implemented in PdfSharpCore. 49 | /// 50 | Union = 2, 51 | 52 | /// 53 | /// Not yet implemented in PdfSharpCore. 54 | /// 55 | Xor = 3, 56 | 57 | /// 58 | /// Not yet implemented in PdfSharpCore. 59 | /// 60 | Exclude = 4, 61 | 62 | /// 63 | /// Not yet implemented in PdfSharpCore. 64 | /// 65 | Complement = 5, 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XDashStyle.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Specifies the style of dashed lines drawn with an XPen object. 34 | /// 35 | public enum XDashStyle // Same values as System.Drawing.Drawing2D.DashStyle. 36 | { 37 | /// 38 | /// Specifies a solid line. 39 | /// 40 | Solid = 0, 41 | 42 | /// 43 | /// Specifies a line consisting of dashes. 44 | /// 45 | Dash = 1, 46 | 47 | /// 48 | /// Specifies a line consisting of dots. 49 | /// 50 | Dot = 2, 51 | 52 | /// 53 | /// Specifies a line consisting of a repeating pattern of dash-dot. 54 | /// 55 | DashDot = 3, 56 | 57 | /// 58 | /// Specifies a line consisting of a repeating pattern of dash-dot-dot. 59 | /// 60 | DashDotDot = 4, 61 | 62 | /// 63 | /// Specifies a user-defined custom dash style. 64 | /// 65 | Custom = 5, 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XFillMode.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Specifies how the interior of a closed path is filled. 34 | /// 35 | public enum XFillMode // Same values as System.Drawing.FillMode. 36 | { 37 | /// 38 | /// Specifies the alternate fill mode. Called the 'odd-even rule' in PDF terminology. 39 | /// 40 | Alternate = 0, 41 | 42 | /// 43 | /// Specifies the winding fill mode. Called the 'nonzero winding number rule' in PDF terminology. 44 | /// 45 | Winding = 1, 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XFontStyle.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Drawing 33 | { 34 | /// 35 | /// Specifies style information applied to text. 36 | /// 37 | [Flags] 38 | public enum XFontStyle // Same values as System.Drawing.FontStyle. 39 | { 40 | /// 41 | /// Normal text. 42 | /// 43 | Regular = XGdiFontStyle.Regular, 44 | 45 | /// 46 | /// Bold text. 47 | /// 48 | Bold = XGdiFontStyle.Bold, 49 | 50 | /// 51 | /// Italic text. 52 | /// 53 | Italic = XGdiFontStyle.Italic, 54 | 55 | /// 56 | /// Bold and italic text. 57 | /// 58 | BoldItalic = XGdiFontStyle.BoldItalic, 59 | 60 | /// 61 | /// Underlined text. 62 | /// 63 | Underline = XGdiFontStyle.Underline, 64 | 65 | /// 66 | /// Text with a line through the middle. 67 | /// 68 | Strikeout = XGdiFontStyle.Strikeout, 69 | 70 | // Additional flags: 71 | // BoldSimulation 72 | // ItalicSimulation // It is not ObliqueSimulation, because oblique is what is what you get and this simulates italic. 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XGdiFontStyle.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | using System.Collections.Generic; 32 | using System.Text; 33 | 34 | namespace Didstopia.PDFSharp.Drawing 35 | { 36 | /// 37 | /// Backward compatibility. 38 | /// 39 | [Flags] 40 | internal enum XGdiFontStyle // Same values as System.Drawing.FontStyle. 41 | { 42 | // Must be identical to both: 43 | // System.Drawing.FontStyle and 44 | // PdfSharpCore.Drawing.FontStyle 45 | 46 | /// 47 | /// Normal text. 48 | /// 49 | Regular = 0, 50 | 51 | /// 52 | /// Bold text. 53 | /// 54 | Bold = 1, 55 | 56 | /// 57 | /// Italic text. 58 | /// 59 | Italic = 2, 60 | 61 | /// 62 | /// Bold and italic text. 63 | /// 64 | BoldItalic = 3, 65 | 66 | /// 67 | /// Underlined text. 68 | /// 69 | Underline = 4, 70 | 71 | /// 72 | /// Text with a line through the middle. 73 | /// 74 | Strikeout = 8, 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XGraphicRenderTarget.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | // ReSharper disable InconsistentNaming 31 | 32 | namespace Didstopia.PDFSharp.Drawing 33 | { 34 | /// 35 | /// Determines whether rendering based on GDI+ or WPF. 36 | /// For internal use in hybrid build only only. 37 | /// 38 | enum XGraphicTargetContext 39 | { 40 | // NETFX_CORE_TODO 41 | NONE = 0, 42 | 43 | /// 44 | /// Rendering does not depent on a particular technology. 45 | /// 46 | CORE = 1, 47 | 48 | /// 49 | /// Renders using GDI+. 50 | /// 51 | GDI = 2, 52 | 53 | /// 54 | /// Renders using WPF (including Silverlight). 55 | /// 56 | WPF = 3, 57 | 58 | /// 59 | /// Universal Windows Platform. 60 | /// 61 | UWP = 10, 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XGraphicsPathItemType.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Type of the path data. 34 | /// 35 | internal enum XGraphicsPathItemType 36 | { 37 | Lines, 38 | Beziers, 39 | Curve, 40 | Arc, 41 | Rectangle, 42 | RoundedRectangle, 43 | Ellipse, 44 | Polygon, 45 | CloseFigure, 46 | StartFigure, 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XGraphicsPdfPageOptions.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Specifies how the content of an existing PDF page and new content is combined. 34 | /// 35 | public enum XGraphicsPdfPageOptions 36 | { 37 | /// 38 | /// The new content is inserted behind the old content and any subsequent drawing in done above the existing graphic. 39 | /// 40 | Append, 41 | 42 | /// 43 | /// The new content is inserted before the old content and any subsequent drawing in done beneath the existing graphic. 44 | /// 45 | Prepend, 46 | 47 | /// 48 | /// The new content entirely replaces the old content and any subsequent drawing in done on a blank page. 49 | /// 50 | Replace, 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XGraphicsUnit.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Specifies the unit of measure. 34 | /// 35 | public enum XGraphicsUnit // NOT the same values as System.Drawing.GraphicsUnit 36 | { 37 | /// 38 | /// Specifies a printer's point (1/72 inch) as the unit of measure. 39 | /// 40 | Point = 0, // Must be 0 to let a new XUnit be 0 point. 41 | 42 | /// 43 | /// Specifies the inch (2.54 cm) as the unit of measure. 44 | /// 45 | Inch = 1, 46 | 47 | /// 48 | /// Specifies the millimeter as the unit of measure. 49 | /// 50 | Millimeter = 2, 51 | 52 | /// 53 | /// Specifies the centimeter as the unit of measure. 54 | /// 55 | Centimeter = 3, 56 | 57 | /// 58 | /// Specifies a presentation point (1/96 inch) as the unit of measure. 59 | /// 60 | Presentation = 4, 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XLineAlignment.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Specifies the alignment of a text string relative to its layout rectangle 34 | /// 35 | public enum XLineAlignment // same values as System.Drawing.StringAlignment (except BaseLine) 36 | { 37 | /// 38 | /// Specifies the text be aligned near the layout. 39 | /// In a left-to-right layout, the near position is left. In a right-to-left layout, the near 40 | /// position is right. 41 | /// 42 | Near = 0, 43 | 44 | /// 45 | /// Specifies that text is aligned in the center of the layout rectangle. 46 | /// 47 | Center = 1, 48 | 49 | /// 50 | /// Specifies that text is aligned far from the origin position of the layout rectangle. 51 | /// In a left-to-right layout, the far position is right. In a right-to-left layout, the far 52 | /// position is left. 53 | /// 54 | Far = 2, 55 | 56 | /// 57 | /// Specifies that text is aligned relative to its base line. 58 | /// With this option the layout rectangle must have a height of 0. 59 | /// 60 | BaseLine = 3, 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XLineCap.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Specifies the available cap styles with which an XPen object can start and end a line. 34 | /// 35 | public enum XLineCap 36 | { 37 | /// 38 | /// Specifies a flat line cap. 39 | /// 40 | Flat = 0, 41 | 42 | /// 43 | /// Specifies a round line cap. 44 | /// 45 | Round = 1, 46 | 47 | /// 48 | /// Specifies a square line cap. 49 | /// 50 | Square = 2 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XLineJoin.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Specifies how to join consecutive line or curve segments in a figure or subpath. 34 | /// 35 | public enum XLineJoin 36 | { 37 | /// 38 | /// Specifies a mitered join. This produces a sharp corner or a clipped corner, 39 | /// depending on whether the length of the miter exceeds the miter limit 40 | /// 41 | Miter = 0, 42 | 43 | /// 44 | /// Specifies a circular join. This produces a smooth, circular arc between the lines. 45 | /// 46 | Round = 1, 47 | 48 | /// 49 | /// Specifies a beveled join. This produces a diagonal corner. 50 | /// 51 | Bevel = 2, 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XLinearGradientMode.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Specifies the direction of a linear gradient. 34 | /// 35 | public enum XLinearGradientMode // same values as System.Drawing.LinearGradientMode 36 | { 37 | /// 38 | /// Specifies a gradient from left to right. 39 | /// 40 | Horizontal = 0, 41 | 42 | /// 43 | /// Specifies a gradient from top to bottom. 44 | /// 45 | Vertical = 1, 46 | 47 | /// 48 | /// Specifies a gradient from upper left to lower right. 49 | /// 50 | ForwardDiagonal = 2, 51 | 52 | /// 53 | /// Specifies a gradient from upper right to lower left. 54 | /// 55 | BackwardDiagonal = 3, 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XMatrixOrder.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Specifies the order for matrix transform operations. 34 | /// 35 | public enum XMatrixOrder 36 | { 37 | /// 38 | /// The new operation is applied before the old operation. 39 | /// 40 | Prepend = 0, 41 | 42 | /// 43 | /// The new operation is applied after the old operation. 44 | /// 45 | Append = 1, 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XPageDirection.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Drawing 33 | { 34 | /// 35 | /// Specifies the direction of the y-axis. 36 | /// 37 | public enum XPageDirection 38 | { 39 | /// 40 | /// Increasing Y values go downwards. This is the default. 41 | /// 42 | Downwards = 0, 43 | 44 | /// 45 | /// Increasing Y values go upwards. This is only possible when drawing on a PDF page. 46 | /// It is not implemented when drawing on a System.Drawing.Graphics object. 47 | /// 48 | [Obsolete("Not implemeted - yagni")] 49 | Upwards = 1, // Possible, but needs a lot of case differentiation - postponed. 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XSmoothingMode.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Drawing 33 | { 34 | /// 35 | /// Specifies whether smoothing (or antialiasing) is applied to lines and curves 36 | /// and the edges of filled areas. 37 | /// 38 | [Flags] 39 | public enum XSmoothingMode // same values as System.Drawing.Drawing2D.SmoothingMode 40 | { 41 | // Not used in PDF rendering process. 42 | 43 | /// 44 | /// Specifies an invalid mode. 45 | /// 46 | Invalid = -1, 47 | 48 | /// 49 | /// Specifies the default mode. 50 | /// 51 | Default = 0, 52 | 53 | /// 54 | /// Specifies high speed, low quality rendering. 55 | /// 56 | HighSpeed = 1, 57 | 58 | /// 59 | /// Specifies high quality, low speed rendering. 60 | /// 61 | HighQuality = 2, 62 | 63 | /// 64 | /// Specifies no antialiasing. 65 | /// 66 | None = 3, 67 | 68 | /// 69 | /// Specifies antialiased rendering. 70 | /// 71 | AntiAlias = 4, 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XStringAlignment.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Specifies the alignment of a text string relative to its layout rectangle. 34 | /// 35 | public enum XStringAlignment // Same values as System.Drawing.StringAlignment. 36 | { 37 | /// 38 | /// Specifies the text be aligned near the layout. 39 | /// In a left-to-right layout, the near position is left. In a right-to-left layout, the near 40 | /// position is right. 41 | /// 42 | Near = 0, 43 | 44 | /// 45 | /// Specifies that text is aligned in the center of the layout rectangle. 46 | /// 47 | Center = 1, 48 | 49 | /// 50 | /// Specifies that text is aligned far from the origin position of the layout rectangle. 51 | /// In a left-to-right layout, the far position is right. In a right-to-left layout, the far 52 | /// position is left. 53 | /// 54 | Far = 2, 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XStyleSimulations.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Drawing 33 | { 34 | /// 35 | /// Describes the simulation style of a font. 36 | /// 37 | [Flags] 38 | public enum XStyleSimulations // Identical to WpfStyleSimulations. 39 | { 40 | /// 41 | /// No font style simulation. 42 | /// 43 | None = 0, 44 | 45 | /// 46 | /// Bold style simulation. 47 | /// 48 | BoldSimulation = 1, 49 | 50 | /// 51 | /// Italic style simulation. 52 | /// 53 | ItalicSimulation = 2, 54 | 55 | /// 56 | /// Bold and Italic style simulation. 57 | /// 58 | BoldItalicSimulation = ItalicSimulation | BoldSimulation, 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Drawing/enums/XSweepDirection.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Drawing 31 | { 32 | /// 33 | /// Defines the direction an elliptical arc is drawn. 34 | /// 35 | public enum XSweepDirection // Same values as System.Windows.Media.SweepDirection. 36 | { 37 | /// 38 | /// Specifies that arcs are drawn in a counter clockwise (negative-angle) direction. 39 | /// 40 | Counterclockwise = 0, 41 | 42 | /// 43 | /// Specifies that arcs are drawn in a clockwise (positive-angle) direction. 44 | /// 45 | Clockwise = 1, 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Fonts.OpenType/GlyphDataTable.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Fonts.OpenType/GlyphDataTable.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Fonts.OpenType/IndexToLocationTable.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Fonts.OpenType/IndexToLocationTable.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Fonts.OpenType/OpenTypeFontTables.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Fonts.OpenType/OpenTypeFontTables.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Fonts.OpenType/OpenTypeFontWriter.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System.Diagnostics; 31 | using System.IO; 32 | 33 | namespace Didstopia.PDFSharp.Fonts.OpenType 34 | { 35 | /// 36 | /// Represents a writer for True Type font files. 37 | /// 38 | internal class OpenTypeFontWriter : FontWriter 39 | { 40 | /// 41 | /// Initializes a new instance of the class. 42 | /// 43 | public OpenTypeFontWriter(Stream stream) 44 | : base(stream) 45 | { } 46 | 47 | /// 48 | /// Writes a table name. 49 | /// 50 | public void WriteTag(string tag) 51 | { 52 | Debug.Assert(tag.Length == 4); 53 | WriteByte((byte)(tag[0])); 54 | WriteByte((byte)(tag[1])); 55 | WriteByte((byte)(tag[2])); 56 | WriteByte((byte)(tag[3])); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Fonts.OpenType/OpenTypeFontface.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Fonts.OpenType/OpenTypeFontface.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Fonts.OpenType/TableDirectoryEntry.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Fonts.OpenType/TableDirectoryEntry.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Fonts.OpenType/enums/FontTechnology.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Fonts.OpenType 31 | { 32 | /// 33 | /// Identifies the technology of an OpenType font file. 34 | /// 35 | enum FontTechnology 36 | { 37 | /// 38 | /// Font is Adobe Postscript font in CFF. 39 | /// 40 | PostscriptOutlines, 41 | 42 | /// 43 | /// Font is a TrueType font. 44 | /// 45 | TrueTypeOutlines, 46 | 47 | /// 48 | /// Font is a TrueType font collection. 49 | /// 50 | TrueTypeCollection 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Fonts/IFontResolver.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Fonts 31 | { 32 | /// 33 | /// Provides functionality that convertes a requested typeface into a physical font. 34 | /// 35 | public interface IFontResolver 36 | { 37 | /// 38 | /// Converts specified information about a required typeface into a specific font. 39 | /// 40 | /// Name of the font family. 41 | /// Set to true when a bold fontface is required. 42 | /// Set to true when an italic fontface is required. 43 | /// Information about the physical font, or null if the request cannot be satisfied. 44 | FontResolverInfo ResolveTypeface(string familyName, bool isBold, bool isItalic); 45 | 46 | //FontResolverInfo ResolveTypeface(Typeface); TODO in PDFsharp 2.0 47 | 48 | /// 49 | /// Gets the bytes of a physical font with specified face name. 50 | /// 51 | /// A face name previously retrieved by ResolveTypeface. 52 | byte[] GetFont(string faceName); 53 | 54 | string DefaultFontName { get; } 55 | } 56 | } -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.AcroForms/PdfAcroField.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.AcroForms/PdfAcroField.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.AcroForms/PdfAcroForm.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.AcroForms/PdfAcroForm.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.AcroForms/PdfCheckBoxField.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.AcroForms/PdfCheckBoxField.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.AcroForms/PdfChoiceField.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.AcroForms/PdfChoiceField.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.AcroForms/PdfComboBoxField.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.AcroForms/PdfComboBoxField.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.AcroForms/PdfSignatureField.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.AcroForms/PdfSignatureField.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.AcroForms/PdfTextField.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.AcroForms/PdfTextField.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.AcroForms/enums/PdfAcroFieldFlags.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.AcroForms/enums/PdfAcroFieldFlags.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Actions/PdfGoToAction.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Actions/PdfGoToAction.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Actions/enums/PdfNamedActionNames.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf.Actions 31 | { 32 | /// 33 | /// Specifies the predefined PDF actions. 34 | /// 35 | public enum PdfNamedActionNames 36 | { 37 | /// 38 | /// Go to next page. 39 | /// 40 | NextPage, 41 | 42 | /// 43 | /// Go to previous page. 44 | /// 45 | PrevPage, 46 | 47 | /// 48 | /// Go to first page. 49 | /// 50 | FirstPage, 51 | 52 | /// 53 | /// Go to last page. 54 | /// 55 | LastPage 56 | } 57 | } -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/IContentStream.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | 31 | 32 | using Didstopia.PDFSharp.Drawing; 33 | 34 | namespace Didstopia.PDFSharp.Pdf.Advanced 35 | { 36 | internal interface IContentStream 37 | { 38 | PdfResources Resources { get; } 39 | 40 | string GetFontName(XFont font, out PdfFont pdfFont); 41 | 42 | string GetFontName(string idName, byte[] fontData, out PdfFont pdfFont); 43 | 44 | string GetImageName(XImage image); 45 | 46 | string GetFormName(XForm form); 47 | } 48 | } -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfCIDFont.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfCIDFont.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfCatalog.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfCatalog.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfExtGState.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfExtGState.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfFont.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfFont.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfFontDescriptor.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfFontDescriptor.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfFormXObject.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfFormXObject.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfGroupAttributes.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfGroupAttributes.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfImage.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfImage.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfPageInheritableObjects.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Pdf.Advanced 33 | { 34 | /// 35 | /// Represents a PDF page object. 36 | /// 37 | internal class PdfPageInheritableObjects : PdfDictionary 38 | { 39 | public PdfPageInheritableObjects() 40 | { } 41 | 42 | // TODO Inheritable Resources not yet supported 43 | 44 | /// 45 | /// 46 | /// 47 | public PdfRectangle MediaBox 48 | { 49 | get { return _mediaBox; } 50 | set { _mediaBox = value; } 51 | } 52 | PdfRectangle _mediaBox; 53 | 54 | public PdfRectangle CropBox 55 | { 56 | get { return _cropBox; } 57 | set { _cropBox = value; } 58 | } 59 | PdfRectangle _cropBox; 60 | 61 | public int Rotate 62 | { 63 | get { return _rotate; } 64 | set 65 | { 66 | if (value % 90 != 0) 67 | throw new ArgumentException("Rotate", "The value must be a multiple of 90."); 68 | _rotate = value; 69 | } 70 | } 71 | int _rotate; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfPageInterals.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf.Advanced 31 | { 32 | #if true_ // Not yet used. 33 | /// 34 | /// TODO 35 | /// 36 | public static class PdfPageInterals 37 | { 38 | // TODO 39 | } 40 | #endif 41 | } 42 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfResourceTable.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Pdf.Advanced 33 | { 34 | /// 35 | /// Base class for FontTable, ImageTable, FormXObjectTable etc. 36 | /// 37 | public class PdfResourceTable 38 | { 39 | /// 40 | /// Base class for document wide resource tables. 41 | /// 42 | public PdfResourceTable(PdfDocument owner) 43 | { 44 | if (owner == null) 45 | throw new ArgumentNullException("owner"); 46 | _owner = owner; 47 | } 48 | 49 | /// 50 | /// Gets the owning document of this resource table. 51 | /// 52 | protected PdfDocument Owner 53 | { 54 | get { return _owner; } 55 | } 56 | readonly PdfDocument _owner; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfShading.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfShading.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfShadingPattern.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfShadingPattern.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfSoftMask.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfSoftMask.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfTilingPattern.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfTilingPattern.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfTrailer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfTrailer.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfTransparencyGroupAttributes.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfTransparencyGroupAttributes.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfTrueTypeFont.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfTrueTypeFont.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfType0Font.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfType0Font.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfType1Font.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Advanced/PdfType1Font.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Advanced/PdfXObject.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf.Advanced 31 | { 32 | /// 33 | /// Base class for all PDF external objects. 34 | /// 35 | public abstract class PdfXObject : PdfDictionary 36 | { 37 | /// 38 | /// Initializes a new instance of the class. 39 | /// 40 | /// The document that owns the object. 41 | protected PdfXObject(PdfDocument document) 42 | : base(document) 43 | { } 44 | 45 | /// 46 | /// Predefined keys of this dictionary. 47 | /// 48 | public class Keys : PdfStream.Keys 49 | { } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Annotations/PdfAnnotation.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Annotations/PdfAnnotation.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Annotations/PdfGenericAnnotation.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf.Annotations 31 | { 32 | /// 33 | /// Represents a generic annotation. Used for annotation dictionaries unknown to PdfSharpCore. 34 | /// 35 | internal sealed class PdfGenericAnnotation : PdfAnnotation 36 | { 37 | //DMH 6/7/06 38 | //Make this public so we can use it in PdfAnnotations to 39 | //get the Meta data from existings annotations. 40 | public PdfGenericAnnotation(PdfDictionary dict) 41 | : base(dict) 42 | { } 43 | 44 | /// 45 | /// Predefined keys of this dictionary. 46 | /// 47 | internal new class Keys : PdfAnnotation.Keys 48 | { 49 | public static DictionaryMeta Meta 50 | { 51 | get { return _meta ?? (_meta = CreateMeta(typeof(Keys))); } 52 | } 53 | static DictionaryMeta _meta; 54 | } 55 | 56 | /// 57 | /// Gets the KeysMeta of this dictionary type. 58 | /// 59 | internal override DictionaryMeta Meta 60 | { 61 | get { return Keys.Meta; } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Annotations/PdfLinkAnnotation.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Annotations/PdfLinkAnnotation.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Annotations/PdfWidgetAnnotation.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Annotations/PdfWidgetAnnotation.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Annotations/enums/PdfAnnotationFlags.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Annotations/enums/PdfAnnotationFlags.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Annotations/enums/PdfTextAnnotationIcon.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf.Annotations 31 | { 32 | /// 33 | /// Specifies the pre-defined icon names of text annotations. 34 | /// 35 | public enum PdfTextAnnotationIcon 36 | { 37 | /// 38 | /// A pre-defined annotation icon. 39 | /// 40 | NoIcon, 41 | 42 | /// 43 | /// A pre-defined annotation icon. 44 | /// 45 | Comment, 46 | 47 | /// 48 | /// A pre-defined annotation icon. 49 | /// 50 | Help, 51 | 52 | /// 53 | /// A pre-defined annotation icon. 54 | /// 55 | Insert, 56 | 57 | /// 58 | /// A pre-defined annotation icon. 59 | /// 60 | Key, 61 | 62 | /// 63 | /// A pre-defined annotation icon. 64 | /// 65 | NewParagraph, 66 | 67 | /// 68 | /// A pre-defined annotation icon. 69 | /// 70 | Note, 71 | 72 | /// 73 | /// A pre-defined annotation icon. 74 | /// 75 | Paragraph, 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Content.Objects/enum/OpCodeFlags.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Pdf.Content.Objects 33 | { 34 | /// 35 | /// Specifies the group of operations the op-code belongs to. 36 | /// 37 | [Flags] 38 | public enum OpCodeFlags 39 | { 40 | /// 41 | /// 42 | /// 43 | None, 44 | 45 | /// 46 | /// 47 | /// 48 | TextOut = 0x0001, 49 | //Color, Pattern, Images,... 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Content.Objects/enum/OpCodeName.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | #pragma warning disable 1591 31 | 32 | // ReSharper disable InconsistentNaming 33 | 34 | namespace Didstopia.PDFSharp.Pdf.Content.Objects 35 | { 36 | /// 37 | /// The names of the op-codes. 38 | /// 39 | public enum OpCodeName 40 | { 41 | Dictionary, // Name followed by dictionary. 42 | 43 | // I know that this is not useable in VB or other languages with no case sensitivity. 44 | b, B, bx, Bx, BDC, BI, BMC, BT, BX, c, cm, CS, cs, d, d0, d1, Do, 45 | DP, EI, EMC, ET, EX, f, F, fx, G, g, gs, h, i, ID, j, J, K, k, l, m, M, MP, 46 | n, q, Q, re, RG, rg, ri, s, S, SC, sc, SCN, scn, sh, 47 | Tx, Tc, Td, TD, Tf, Tj, TJ, TL, Tm, Tr, Ts, Tw, Tz, v, w, W, Wx, y, 48 | QuoteSingle, QuoteDbl, 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Content/CLexer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Content/CLexer.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Content/ContentReaderException.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Pdf.Content 33 | { 34 | /// 35 | /// Exception thrown by ContentReader. 36 | /// 37 | public class ContentReaderException : PdfSharpException 38 | { 39 | /// 40 | /// Initializes a new instance of the class. 41 | /// 42 | public ContentReaderException() 43 | { } 44 | 45 | /// 46 | /// Initializes a new instance of the class. 47 | /// 48 | /// The message. 49 | public ContentReaderException(string message) 50 | : base(message) 51 | { } 52 | 53 | /// 54 | /// Initializes a new instance of the class. 55 | /// 56 | /// The message. 57 | /// The inner exception. 58 | public ContentReaderException(string message, Exception innerException) : 59 | base(message, innerException) 60 | { } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Content/enums/Symbol.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf.Content 31 | { 32 | /// 33 | /// Terminal symbols recognized by PDF content stream lexer. 34 | /// 35 | public enum CSymbol 36 | { 37 | #pragma warning disable 1591 38 | None, 39 | Comment, 40 | Integer, 41 | Real, 42 | /*Boolean?,*/ 43 | String, 44 | HexString, 45 | UnicodeString, 46 | UnicodeHexString, 47 | Name, 48 | Operator, 49 | BeginArray, 50 | EndArray, 51 | Dictionary, // HACK: << ... >> is scanned as string literal. 52 | Eof, 53 | Error = -1, 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.IO/Chars.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.IO/Chars.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.IO/Lexer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.IO/Lexer.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.IO/Parser.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.IO/Parser.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.IO/PdfReader.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.IO/PdfReader.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.IO/PdfReaderException.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Pdf.IO 33 | { 34 | /// 35 | /// Exception thrown by PdfReader. 36 | /// 37 | public class PdfReaderException : PdfSharpException 38 | { 39 | /// 40 | /// Initializes a new instance of the class. 41 | /// 42 | public PdfReaderException() 43 | { } 44 | 45 | /// 46 | /// Initializes a new instance of the class. 47 | /// 48 | /// The message. 49 | public PdfReaderException(string message) 50 | : base(message) 51 | { } 52 | 53 | /// 54 | /// Initializes a new instance of the class. 55 | /// 56 | /// The message. 57 | /// The inner exception. 58 | public PdfReaderException(string message, Exception innerException) 59 | : 60 | base(message, innerException) 61 | { } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.IO/PdfWriter.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.IO/PdfWriter.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.IO/enums/PasswordValidity.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf.IO 31 | { 32 | /// 33 | /// Determines the type of the password. 34 | /// 35 | public enum PasswordValidity 36 | { 37 | /// 38 | /// Password is neither user nor owner password. 39 | /// 40 | Invalid, 41 | 42 | /// 43 | /// Password is user password. 44 | /// 45 | UserPassword, 46 | 47 | /// 48 | /// Password is owner password. 49 | /// 50 | OwnerPassword, 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.IO/enums/PdfWriterOptions.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Pdf.IO 33 | { 34 | /// 35 | /// INTERNAL USE ONLY. 36 | /// 37 | [Flags] 38 | internal enum PdfWriterOptions 39 | { 40 | /// 41 | /// If only this flag is specified the result is a regular valid PDF stream. 42 | /// 43 | Regular = 0x000000, 44 | 45 | /// 46 | /// Omit writing stream data. For debugging purposes only. 47 | /// With this option the result is not valid PDF. 48 | /// 49 | OmitStream = 0x000001, 50 | 51 | /// 52 | /// Omit inflate filter. For debugging purposes only. 53 | /// 54 | OmitInflation = 0x000002, 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.IO/enums/Symbol.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf.IO 31 | { 32 | /// 33 | /// Terminal symbols recognized by lexer. 34 | /// 35 | public enum Symbol 36 | { 37 | #pragma warning disable 1591 38 | None, 39 | Comment, Null, Integer, UInteger, Real, Boolean, String, HexString, UnicodeString, UnicodeHexString, 40 | Name, Keyword, 41 | BeginStream, EndStream, 42 | BeginArray, EndArray, 43 | BeginDictionary, EndDictionary, 44 | Obj, EndObj, R, XRef, Trailer, StartXRef, Eof, 45 | #pragma warning restore 1591 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Internal/AnsiEncoding.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Internal/AnsiEncoding.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Internal/PdfDiagnostics.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf.Internal 31 | { 32 | class PdfDiagnostics 33 | { 34 | public static bool TraceCompressedObjects 35 | { 36 | get { return _traceCompressedObjects; } 37 | set { _traceCompressedObjects = value; } 38 | } 39 | static bool _traceCompressedObjects = true; 40 | 41 | public static bool TraceXrefStreams 42 | { 43 | get { return _traceXrefStreams && TraceCompressedObjects; } 44 | set { _traceXrefStreams = value; } 45 | } 46 | static bool _traceXrefStreams = true; 47 | 48 | public static bool TraceObjectStreams 49 | { 50 | get { return _traceObjectStreams && TraceCompressedObjects; } 51 | set { _traceObjectStreams = value; } 52 | } 53 | static bool _traceObjectStreams = true; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Internal/PdfEncoders.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Internal/PdfEncoders.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Security/PdfStandardSecurityHandler.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Security/PdfStandardSecurityHandler.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Security/enums/PdfDocumentSecurity.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf.Security 31 | { 32 | /// 33 | /// Specifies the security level of the PDF document. 34 | /// 35 | public enum PdfDocumentSecurityLevel 36 | { 37 | /// 38 | /// Document is not protected. 39 | /// 40 | None, 41 | 42 | /// 43 | /// Document is protected with 40-bit security. This option is for compatibility with 44 | /// Acrobat 3 and 4 only. Use Encrypted128Bit whenever possible. 45 | /// 46 | Encrypted40Bit, 47 | 48 | /// 49 | /// Document is protected with 128-bit security. 50 | /// 51 | Encrypted128Bit, 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf.Security/enums/PdfUserAccessPermission.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf.Security/enums/PdfUserAccessPermission.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/KeysBase.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Pdf 33 | { 34 | /// 35 | /// Base class for all dictionary Keys classes. 36 | /// 37 | public class KeysBase 38 | { 39 | internal static DictionaryMeta CreateMeta(Type type) 40 | { 41 | return new DictionaryMeta(type); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/PdfBooleanObject.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf/PdfBooleanObject.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/PdfDocumentInformation.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf/PdfDocumentInformation.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/PdfDocumentSettings.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf 31 | { 32 | /// 33 | /// Holds PDF specific information of the document. 34 | /// 35 | public sealed class PdfDocumentSettings 36 | { 37 | internal PdfDocumentSettings(PdfDocument document) 38 | { } 39 | 40 | /// 41 | /// Gets or sets the default trim margins. 42 | /// 43 | public TrimMargins TrimMargins 44 | { 45 | get 46 | { 47 | if (_trimMargins == null) 48 | _trimMargins = new TrimMargins(); 49 | return _trimMargins; 50 | } 51 | set 52 | { 53 | if (_trimMargins == null) 54 | _trimMargins = new TrimMargins(); 55 | if (value != null) 56 | { 57 | _trimMargins.Left = value.Left; 58 | _trimMargins.Right = value.Right; 59 | _trimMargins.Top = value.Top; 60 | _trimMargins.Bottom = value.Bottom; 61 | } 62 | else 63 | _trimMargins.All = 0; 64 | } 65 | } 66 | TrimMargins _trimMargins = new TrimMargins(); 67 | } 68 | } -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/PdfItem.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | using Didstopia.PDFSharp.Pdf.IO; 32 | 33 | namespace Didstopia.PDFSharp.Pdf 34 | { 35 | /// 36 | /// The base class of all PDF objects and simple PDF types. 37 | /// 38 | public abstract class PdfItem : ICloneable 39 | { 40 | // All simple types (i.e. derived from PdfItem but not from PdfObject) must be immutable. 41 | 42 | object ICloneable.Clone() 43 | { 44 | return Copy(); 45 | } 46 | 47 | /// 48 | /// Creates a copy of this object. 49 | /// 50 | public PdfItem Clone() 51 | { 52 | return (PdfItem)Copy(); 53 | } 54 | 55 | /// 56 | /// Implements the copy mechanism. Must be overridden in derived classes. 57 | /// 58 | protected virtual object Copy() 59 | { 60 | return MemberwiseClone(); 61 | } 62 | 63 | /// 64 | /// When overridden in a derived class, appends a raw string representation of this object 65 | /// to the specified PdfWriter. 66 | /// 67 | internal abstract void WriteObject(PdfWriter writer); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/PdfNull.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using Didstopia.PDFSharp.Pdf.IO; 31 | 32 | namespace Didstopia.PDFSharp.Pdf 33 | { 34 | /// 35 | /// Represents a indirect reference that is not in the cross reference table. 36 | /// 37 | public sealed class PdfNull : PdfItem 38 | { 39 | // Reference: 3.2.8 Null Object / Page 63 40 | 41 | PdfNull() 42 | { } 43 | 44 | /// 45 | /// Returns a that represents the current . 46 | /// 47 | /// 48 | /// A that represents the current . 49 | /// 50 | public override string ToString() 51 | { 52 | return "null"; 53 | } 54 | 55 | internal override void WriteObject(PdfWriter writer) 56 | { 57 | // Implementet because it must be overridden. 58 | writer.WriteRaw(" null "); 59 | } 60 | 61 | /// 62 | /// The only instance of this class. 63 | /// 64 | public static readonly PdfNull Value = new PdfNull(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/PdfNullObject.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf/PdfNullObject.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/PdfNumber.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf 31 | { 32 | /// 33 | /// Base class for direct number values (not yet used, maybe superfluous). 34 | /// 35 | public abstract class PdfNumber : PdfItem 36 | { 37 | // No code in base class. 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/PdfNumberObject.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf 31 | { 32 | /// 33 | /// Base class for indirect number values (not yet used, maybe superfluous). 34 | /// 35 | public abstract class PdfNumberObject : PdfObject 36 | { 37 | /// 38 | /// Initializes a new instance of the class. 39 | /// 40 | protected PdfNumberObject() 41 | { } 42 | 43 | /// 44 | /// Initializes a new instance of the class. 45 | /// 46 | /// The document. 47 | protected PdfNumberObject(PdfDocument document) 48 | : base(document) 49 | { } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/PdfOutline.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf/PdfOutline.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/PdfPage.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf/PdfPage.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/PdfRectangle.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf/PdfRectangle.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/PdfViewerPreferences.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/Pdf/PdfViewerPreferences.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/enums/DocumentState.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Pdf 33 | { 34 | /// 35 | /// Identifies the state of the document 36 | /// 37 | [Flags] 38 | enum DocumentState 39 | { 40 | /// 41 | /// The document was created from scratch. 42 | /// 43 | Created = 0x0001, 44 | 45 | /// 46 | /// The document was created by opening an existing PDF file. 47 | /// 48 | Imported = 0x0002, 49 | 50 | /// 51 | /// The document is disposed. 52 | /// 53 | Disposed = 0x8000, 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/enums/PdfColorMode.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf 31 | { 32 | /// 33 | /// Specifies what color model is used in a PDF document. 34 | /// 35 | public enum PdfColorMode 36 | { 37 | /// 38 | /// All color values are written as specified in the XColor objects they come from. 39 | /// 40 | Undefined, 41 | 42 | /// 43 | /// All colors are converted to RGB. 44 | /// 45 | Rgb, 46 | 47 | /// 48 | /// All colors are converted to CMYK. 49 | /// 50 | Cmyk, 51 | } 52 | } -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/enums/PdfCustomValueCompression.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf 31 | { 32 | /// 33 | /// This class is undocumented and may change or drop in future releases. 34 | /// 35 | public enum PdfCustomValueCompressionMode 36 | { 37 | /// 38 | /// Use document default to determine compression. 39 | /// 40 | Default, 41 | 42 | /// 43 | /// Leave custom values uncompressed. 44 | /// 45 | Uncompressed, 46 | 47 | /// 48 | /// Compress custom values using FlateDecode. 49 | /// 50 | Compressed, 51 | } 52 | } -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/enums/PdfFlateEncodeMode.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf 31 | { 32 | /// 33 | /// Sets the mode for the Deflater (FlateEncoder). 34 | /// 35 | public enum PdfFlateEncodeMode 36 | { 37 | /// 38 | /// The default mode. 39 | /// 40 | Default, 41 | 42 | /// 43 | /// Fast encoding, but larger PDF files. 44 | /// 45 | BestSpeed, 46 | 47 | /// 48 | /// Best compression, but takes more time. 49 | /// 50 | BestCompression, 51 | } 52 | } -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/enums/PdfFontEncoding.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp.Pdf 33 | { 34 | /// 35 | /// Specifies the encoding schema used for an XFont when converted into PDF. 36 | /// 37 | public enum PdfFontEncoding 38 | { 39 | // TABLE 40 | 41 | /// 42 | /// Cause a font to use Windows-1252 encoding to encode text rendered with this font. 43 | /// Same as Windows1252 encoding. 44 | /// 45 | WinAnsi = 0, 46 | 47 | ///// 48 | ///// Cause a font to use Windows-1252 (aka WinAnsi) encoding to encode text rendered with this font. 49 | ///// 50 | //Windows1252 = 0, 51 | 52 | /// 53 | /// Cause a font to use Unicode encoding to encode text rendered with this font. 54 | /// 55 | Unicode = 1 56 | 57 | // Implementation note: PdfFontEncoding uses incorrect terms. 58 | // WinAnsi correspond to WinAnsiEncoding, while Unicode uses glyph indices. 59 | // Furthermre the term WinAnsi is an oxymoron. 60 | // Reference: TABLE D.1 Latin-text encodings / Page 996 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/enums/PdfOutlineStyle.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | // Review: OK - StL/14-10-05 31 | 32 | using System; 33 | 34 | namespace Didstopia.PDFSharp.Pdf 35 | { 36 | /// 37 | /// Specifies the font style for the outline (bookmark) text. 38 | /// 39 | [Flags] 40 | public enum PdfOutlineStyle // Reference: TABLE 8.5 Ouline Item flags / Page 587 41 | { 42 | /// 43 | /// Outline text is displayed using a regular font. 44 | /// 45 | Regular = 0, 46 | 47 | /// 48 | /// Outline text is displayed using an italic font. 49 | /// 50 | Italic = 1, 51 | 52 | /// 53 | /// Outline text is displayed using a bold font. 54 | /// 55 | Bold = 2, 56 | 57 | /// 58 | /// Outline text is displayed using a bold and italic font. 59 | /// 60 | BoldItalic = 3, 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/enums/PdfPageLayout.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf 31 | { 32 | /// 33 | /// Specifies the page layout to be used by a viewer when the document is opened. 34 | /// 35 | public enum PdfPageLayout 36 | { 37 | /// 38 | /// Display one page at a time. 39 | /// 40 | SinglePage, 41 | 42 | /// 43 | /// Display the pages in one column. 44 | /// 45 | OneColumn, 46 | 47 | /// 48 | /// Display the pages in two columns, with oddnumbered pages on the left. 49 | /// 50 | TwoColumnLeft, 51 | 52 | /// 53 | /// Display the pages in two columns, with oddnumbered pages on the right. 54 | /// 55 | TwoColumnRight, 56 | 57 | /// 58 | /// (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left. 59 | /// 60 | TwoPageLeft, 61 | 62 | /// 63 | /// (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right. 64 | /// 65 | TwoPageRight, 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/enums/PdfPageMode.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | // ReSharper disable InconsistentNaming 31 | 32 | namespace Didstopia.PDFSharp.Pdf 33 | { 34 | /// 35 | /// Specifies how the document should be displayed by a viewer when opened. 36 | /// 37 | public enum PdfPageMode 38 | { 39 | /// 40 | /// Neither document outline nor thumbnail images visible. 41 | /// 42 | UseNone, 43 | 44 | /// 45 | /// Document outline visible. 46 | /// 47 | UseOutlines, 48 | 49 | /// 50 | /// Thumbnail images visible. 51 | /// 52 | UseThumbs, 53 | 54 | /// 55 | /// Full-screen mode, with no menu bar, windowcontrols, or any other window visible. 56 | /// 57 | FullScreen, 58 | 59 | /// 60 | /// (PDF 1.5) Optional content group panel visible. 61 | /// 62 | UseOC, 63 | 64 | /// 65 | /// (PDF 1.6) Attachments panel visible. 66 | /// 67 | UseAttachments, 68 | } 69 | } -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/enums/PdfReadingDirection.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf 31 | { 32 | /// 33 | /// Specifies how the document should be displayed by a viewer when opened. 34 | /// 35 | public enum PdfReadingDirection 36 | { 37 | /// 38 | /// Left to right. 39 | /// 40 | LeftToRight, 41 | 42 | /// 43 | /// Right to left (including vertical writing systems, such as Chinese, Japanese, and Korean) 44 | /// 45 | RightToLeft, 46 | } 47 | } -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/enums/PdfTextStringEncoding.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | // ReSharper disable InconsistentNaming 31 | 32 | namespace Didstopia.PDFSharp.Pdf 33 | { 34 | /// 35 | /// Specifies how text strings are encoded. A text string is any text used outside of a page content 36 | /// stream, e.g. document information, outline text, annotation text etc. 37 | /// 38 | public enum PdfTextStringEncoding 39 | { 40 | /// 41 | /// Specifies that hypertext uses PDF DocEncoding. 42 | /// 43 | PDFDocEncoding = 0, 44 | 45 | /// 46 | /// Specifies that hypertext uses unicode encoding. 47 | /// 48 | Unicode = 1, 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/Pdf/enums/PdfUseFlateDecoderForJpegImages.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp.Pdf 31 | { 32 | /// 33 | /// Specifies whether to compress JPEG images with the FlateDecode filter. 34 | /// 35 | public enum PdfUseFlateDecoderForJpegImages 36 | { 37 | /// 38 | /// PDFsharp will try FlateDecode and use it if it leads to a reduction in PDF file size. 39 | /// When FlateEncodeMode is set to BestCompression, this is more likely to reduce the file size, 40 | /// but it takes considerably more time to create the PDF file. 41 | /// 42 | Automatic, 43 | 44 | /// 45 | /// PDFsharp will never use FlateDecode - files may be a few bytes larger, but file creation is faster. 46 | /// 47 | Never, 48 | 49 | /// 50 | /// PDFsharp will always use FlateDecode, even if this leads to larger files; 51 | /// this option is meant for testing purposes only and should not be used for production code. 52 | /// 53 | Always, 54 | } 55 | } -------------------------------------------------------------------------------- /Didstopia.PDFSharp/SharpZipLib/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | This code is an excerpt from the SharpZipLib. The code is unmodified except that all classes 3 | are made internal and moved to the namespace PdfSharpCore.SharpZipLib. 4 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/SharpZipLib/Zip/Compression/DeflaterPending.cs: -------------------------------------------------------------------------------- 1 | // DeflaterPending.cs 2 | // 3 | // Copyright (C) 2001 Mike Krueger 4 | // Copyright (C) 2004 John Reilly 5 | // 6 | // This file was translated from java, it was part of the GNU Classpath 7 | // Copyright (C) 2001 Free Software Foundation, Inc. 8 | // 9 | // This program is free software; you can redistribute it and/or 10 | // modify it under the terms of the GNU General Public License 11 | // as published by the Free Software Foundation; either version 2 12 | // of the License, or (at your option) any later version. 13 | // 14 | // This program is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with this program; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 | // 23 | // Linking this library statically or dynamically with other modules is 24 | // making a combined work based on this library. Thus, the terms and 25 | // conditions of the GNU General Public License cover the whole 26 | // combination. 27 | // 28 | // As a special exception, the copyright holders of this library give you 29 | // permission to link this library with independent modules to produce an 30 | // executable, regardless of the license terms of these independent 31 | // modules, and to copy and distribute the resulting executable under 32 | // terms of your choice, provided that you also meet, for each linked 33 | // independent module, the terms and conditions of the license of that 34 | // module. An independent module is a module which is not derived from 35 | // or based on this library. If you modify this library, you may extend 36 | // this exception to your version of the library, but you are not 37 | // obligated to do so. If you do not wish to do so, delete this 38 | // exception statement from your version. 39 | 40 | namespace Didstopia.PDFSharp.SharpZipLib.Zip.Compression 41 | { 42 | 43 | /// 44 | /// This class stores the pending output of the Deflater. 45 | /// 46 | /// Author of the original java version: Jochen Hoenicke 47 | /// 48 | internal class DeflaterPending : PendingBuffer 49 | { 50 | /// 51 | /// Construct instance with default buffer size 52 | /// 53 | public DeflaterPending() 54 | : base(DeflaterConstants.PENDING_BUF_SIZE) 55 | { 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/root/PageSizeConverter.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/root/PageSizeConverter.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/root/PdfSharpException.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | using System; 31 | 32 | namespace Didstopia.PDFSharp 33 | { 34 | /// 35 | /// Base class of all exceptions in the PDFsharp frame work. 36 | /// 37 | public class PdfSharpException : Exception 38 | { 39 | // The class is not yet used 40 | 41 | /// 42 | /// Initializes a new instance of the class. 43 | /// 44 | public PdfSharpException() 45 | { } 46 | 47 | /// 48 | /// Initializes a new instance of the class. 49 | /// 50 | /// The exception message. 51 | public PdfSharpException(string message) 52 | : base(message) 53 | { } 54 | 55 | /// 56 | /// Initializes a new instance of the class. 57 | /// 58 | /// The exception message. 59 | /// The inner exception. 60 | public PdfSharpException(string message, Exception innerException) : 61 | base(message, innerException) 62 | { } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/root/ProductVersionInfo.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/root/ProductVersionInfo.cs -------------------------------------------------------------------------------- /Didstopia.PDFSharp/root/VersionInfo.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp 31 | { 32 | /// 33 | /// Version info of this assembly. 34 | /// 35 | static class VersionInfo 36 | { 37 | public const string Title = ProductVersionInfo.Title; 38 | public const string Description = ProductVersionInfo.Description; 39 | public const string Producer = ProductVersionInfo.Producer; 40 | public const string Version = ProductVersionInfo.Version; 41 | public const string Url = ProductVersionInfo.Url; 42 | public const string Configuration = ""; 43 | public const string Company = ProductVersionInfo.Company; 44 | public const string Product = ProductVersionInfo.Product; 45 | public const string Copyright = ProductVersionInfo.Copyright; 46 | public const string Trademark = ProductVersionInfo.Trademark; 47 | public const string Culture = ""; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/root/enums/PageOrientation.cs: -------------------------------------------------------------------------------- 1 | #region PDFsharp - A .NET library for processing PDF 2 | // 3 | // Authors: 4 | // Stefan Lange 5 | // 6 | // Copyright (c) 2005-2016 empira Software GmbH, Cologne Area (Germany) 7 | // 8 | // http://www.PdfSharpCore.com 9 | // http://sourceforge.net/projects/pdfsharp 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a 12 | // copy of this software and associated documentation files (the "Software"), 13 | // to deal in the Software without restriction, including without limitation 14 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, 15 | // and/or sell copies of the Software, and to permit persons to whom the 16 | // Software is furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included 19 | // in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 24 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 27 | // DEALINGS IN THE SOFTWARE. 28 | #endregion 29 | 30 | namespace Didstopia.PDFSharp 31 | { 32 | /// 33 | /// Base namespace of PdfSharpCore. Most classes are implemented in nested namespaces like e. g. PdfSharpCore.Pdf. 34 | /// 35 | /// 36 | [System.Runtime.CompilerServices.CompilerGenerated] 37 | internal class NamespaceDoc { } 38 | 39 | /// 40 | /// Specifies the orientation of a page. 41 | /// 42 | public enum PageOrientation 43 | { 44 | /// 45 | /// The default page orientation. 46 | /// 47 | Portrait, 48 | 49 | /// 50 | /// The width and height of the page are reversed. 51 | /// 52 | Landscape, 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Didstopia.PDFSharp/root/enums/PageSize.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Didstopia/PDFSharp/316b0041caa81ca43f5e21d9e3d786715728a934/Didstopia.PDFSharp/root/enums/PageSize.cs -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2005-2007 empira Software GmbH, Cologne (Germany) 4 | Copyright (c) 2016 David Dunscombe 5 | Copyright (c) 2017 Stefan Steiger 6 | Copyright (c) 2017 Didstopia 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PDFSharp for .NET Standard 2.0 2 | 3 | [![Build Status](https://travis-ci.org/Didstopia/PDFSharp.svg?branch=master)](https://travis-ci.org/Didstopia/PDFSharp) 4 | [![NuGet](https://img.shields.io/nuget/dt/Didstopia.PDFSharp.svg)](https://www.nuget.org/packages/Didstopia.PDFSharp) 5 | 6 | A .NET Standard 2.0 library for reading, writing and editing PDF files. 7 | 8 | **DISCLAIMER:** This is a modified fork based on several OSS projects. For more information see [Licenses](https://github.com/Didstopia/PDFSharp/blob/master/README.md#licenses) or [LICENSE.md](https://github.com/Didstopia/PDFSharp/blob/master/LICENSE.md). 9 | 10 | ## What works vs. doesn't work 11 | 12 | - [x] Creating, modifying, loading and saving PDF documents 13 | - [x] Loading custom fonts, drawing text on PDF documents 14 | - [x] Encrypted (password protected) PDF documents ([#3](https://github.com/Didstopia/PDFSharp/issues/3)) 15 | 16 | It's important to note that this is **prerelease software**, meaning some things work while others do not. 17 | 18 | If you come across a PDFSharp feature that you know should work (but doesn't), please submit an issue or pull request so we can slowly move towards a stable release. 19 | 20 | ## Usage 21 | 22 | See the [official PDFSharp samples](http://www.pdfsharp.net/wiki/PDFsharpSamples.ashx). 23 | 24 | ## Licenses 25 | 26 | This project is provided under the [MIT License](https://github.com/Didstopia/PDFSharp/blob/master/LICENSE.md). 27 | 28 | The following licenses also apply to this project: 29 | - [PdfSharpCore](https://github.com/ststeiger/PdfSharpCore/blob/master/README.md#license) 30 | - [PdfSharp.Xamarin](https://github.com/roceh/PdfSharp.Xamarin/blob/master/README.md#license) 31 | - [PdfSharp](http://www.pdfsharp.net/PDFsharp_License.ashx) 32 | --------------------------------------------------------------------------------