ScanSnapã§æ¬ãã¹ãã£ã³ãã¦ãã¿ãã¬ããã§èªãã®ã¯æé«ã§ãããè²·ã£ããã©èªãã§ãªããããããç©ãèªæ¬ã400gãããã®ã¿ãã¬ããã®ä¸ã«100å以ä¸ç©ã¾ãã¦ãããã¨æãã¨ããã¾ããªãå¿«æãè¦ãã¦æ°ã失ãããã«ãªããã©ããã¦ãããªã«è²·ã£ãã®ãã
ããã¯ãã¦ãããæ¬ãè£æãã¦ã¹ãã£ã³ããã¨ãããã©ã«ãã§ã¯PDFã¯å³éãã«ãªããã¤ã¾ãã横æ¸ãã®æ¬ã®ããã«å·¦å´ãéããããã
(ã¡ãªã¿ã«ãä¸ã®ãããããã絵㯠【製本】右綴じ・左綴じの理由と冊子作成時のポイント – 冊子製本お役立ちコラム ãããã¯ã£ã¦ãããæè¬ãããã¦ãªã³ã¯ããã¦ãã)
æè¡æ¸ãè²·ãã®ã§ãã¡ããå ¨ã¦ã§ã¯ãªãããæ¥æ¬äººãªã®ã§å¤ãã®æ¬ãå³ç¶´ãã ããããPDFç·¨éã½ããã§å¤æ´ãã¦ããå¿ è¦ããããããããªããªããã£ããã§ããã
ã¾ããæ¥æ¬ä»¥å¤ã§ä½ãããPDFç·¨éã½ããã«ã¯ãããã綴ãæ¹ã®å¤æ´æ©è½ããªãã£ãããããå³ç¶´ãããæ¬ãä¸ã®ä¸ã«ãããã¨ãç¥ããã®ã ãåããããã
çéã¯ãAdobe Acrobatã ããããããã¾ãAcrobatã¯ãµãã¹ã¯ã§ãæé¡1500åããããã¡ãããã«ãã¼ã®è£ã®ç½ç´ãåé¤ããããã«ãã¼è£ãæå¾ã«ãªãã±ã«ä»ãããããã®ã§ãã¼ã¸ã®åé¤ãå ¥ãæãæ©è½ã使ããããããããã«å¹´é18000å以ä¸æãã®ã¯ãããã
ãããªäººã®çºã«ã徳島謹製JustSystemã®JUST PDFãã½ã¼ã¹ãã¯ã¹ãããã¯ãããªãPDFã¨ããå½ç£ã½ããã¦ã§ã¢ããããã©ã¡ããæ°ååã§å¤ãããã¡ããã¨ç¶´ãæ¹ãå¤ããããããããããã
ãããããã®ã ãã»ã»ã»ãã®2ã¤ã®ã½ããã¦ã§ã¢ãã©ã¡ããå¾®å¦ã«ä¸å®å®ãã ãããåããããä¸å®å®ã ãä»ã¯ãããªãPDFã使ã£ã¦ãã¦ãå æ¥ããã¼ã¸ã§ã³12ã«ãã¼ã¸ã§ã³ã¢ããããããã£ã3000åã§ãã¼ã¸ã§ã³ã¢ããã§ãã¦ç´ æ´ãããã®ã ããææ¸ã®æå¾ã®ãã¼ã¸ãåé¤ãããã¨ããã¨æã ã¯ã©ãã·ã¥ããä½å¹´ãåãããããã°ã¯å¥å¨ã§ããã¤ãæã ãºã¼ã ãã¿ã³ãåæã«é£æãããã©ãã©ãæ¬ãæ¡å¤§è¡¨ç¤ºããã¦ããã¨ããç´ æµãªãã°ã追å ããã¦ãããæå¥ããããããªå¤æ®µã§ã¯ãªãã®ã ããå¾®å¦ã«ã¹ãã¬ã¹ãæºã¾ããã¾ããã©ã¡ããæ¬ã®èªçããã£ã¦ããå人ã¦ã¼ã¶ã¼ã®ããã«ä½ã£ã¦ããã½ããã§ã¯ãªãã®ã ãä¼ç¤¾ã®ä¸ã§æ¸é¡ãããåããããã¨ã念é ã«ä½ããã¦ãããä½ç¾ãã¼ã¸ãããPDFãæ±ãã¨ä¸å®å®ãªã®ã¯ãã¦ã¼ã¹ã±ã¼ã¹ãããºã¬ã¦ããããã ã
ããã«ããããã大éã«ã¹ãã£ã³ããä½ååãã®PDFãã²ã¨ã¤ãã¤éãã¦ã綴ãæ¹ãå¤ãã¦(ããããã£ã®å¥¥ãªã®ã§ã¯ã¤ãã¯ã¡ãã¥ã¼ã¿ãããªã®ã«ãç»é²ã§ããªãã®ã )ã表ç´ã®è£ã®ç½ç´ãåé¤ãã¦éããã¨ããã®ã¯å°å³ã«å¤§å¤ãªä½æ¥ã ããããããä½ååã¨ãã£ã¦ãããã ãã
ã¨ããããã§ãã¹ãã£ã³çµæã確èªããã(ãã¾ã«ééãã¦2åé£ç¶ã§ã¹ãã£ã³ãã¦ã1ãã¡ã¤ã«ã«2ååå ¥ã£ã¦ãããããã®ã )ãéä¸ã§ã¸ã£ã ã£ã¡ãã£ã¦2ã¤ã®ãã¡ã¤ã«ã«åããã¡ãã£ãã®ãåä½ããããã¯ããã®ã§ããããªãPDFãä¸è¦ã«ã¯ãªããªããã ããæä½æ¥ãæ¸ãã°ã¹ãã¬ã¹ãæ¸ãããªãã¨ãã³ãã³ãã©ã¤ã³ãã¼ã«ã§ä¸æ¬å¦çåºæ¥ãªããã®ã ãããã»ã»ã»ã¨ããã®ãä»åãããããã¨ã ã
ã¨ããããã10年以ä¸åã«C#ã¯æ¸ãããã¨ãããã(VB.NETãããã)ãä»ã«ä½ã«ãç¥èããªãç¶æ ã§Windowsã®ã³ãã³ãã©ã¤ã³ãã¼ã«ãä½ã£ã¦ãããã
ããããã®ã§ãç§ãè¥ãããé ã大å¦çåã®æ£ã®ä¸ã«å¦å²ã§ãã10ä¸åè¿ãå¤æãä»ãããã¦ã§ã£ããç®±ã«å ¥ã£ã¦å¾å ããããããã¦ãããã®Visual Studioãããã¾ãã³ãã¥ããã£çã¯ã¿ãã ãç¹ã«ãªã«ãèãããã¨ãªããã¦ã³ãã¼ããããã¤ã³ã¹ãã¼ã«æã«ASP.netä½ãã®ãã¨ããPythonãæ¸ãã®ã(VSã§Pythonæ¸ããã®ãªã®ããæè¿ã¯)ã¨ããããããèãããããã³ãã³ãã©ã¤ã³ã¢ããªã«ã ããã§ãã¯ãå ¥ãã¦ãããã¾ãããããããªã£ãã足ããã®ã ãããF#ã¯è¿½å ãã¦ããã(ç¬)
èµ·åãã¦ãããã¸ã§ã¯ããä½æãã¦ãHello, Worldã¾ã§ã¯ããã«åºæ¥ããã¹ã ã¼ãºã§ãããVSã®ã¤ã³ã¹ãã¼ã«ããã®ã®æ°åã§çµããã¨ããã®ãä¿¡ããããªãã
ãã¦ãPDFã触ããªããã°ãªããªãããå½ç¶ãä½ãããã®ã©ã¤ãã©ãªãæ¾ã£ã¦ãããã¨ã«ãªãã®ã ãããæè¿ã¯ããããã¨ããAIã«ç¸è«ãããã®ããããPerplexityã«ãPDFã®ç¶´ãæ¹ãå¤ããWindowsã®ã³ã³ã½ã¼ã«ã¢ããªã±ã¼ã·ã§ã³ãä½æãããã§ããPDFç·¨éãè¡ãã©ã¤ãã©ãªãæ¨è¦ãã¦ãã ãããã¨ãé¡ããã¦ã¿ãã
ããã¨ãiText7ã¨PDFSharpã®ã©ã£ã¡ããããããããï¼ã¨ã®ãã¨ãã¨ãããããiText7ãªããã®ãæ¢ãã¦ã¿ãã
ã©ããããããã®ããã ããªããææ°ã¯9ã«ãªã£ã¦ãããï¼
iText Suite .NET (C#) | iText PDF
使ãæ¹ããã£ã±ãããããªããPerplexityãåºãã¦ããããµã³ãã«ãé ¼ãã«ã©ãã«ããããã»ã»ã»ã
ã¨ãããããã¤ã³ã¹ãã¼ã«ããªããã¨ã«ã¯å§ã¾ããªããVisual Studioã®NuGetã®ããã±ã¼ã¸ããã¼ã¸ã£ã³ã³ã½ã¼ã«ã¨ããã¨ãããããé©å½ã«ã³ãã³ããæã£ã¦ã¿ããã³ã³ã½ã¼ã«ãèµ·åããã¨ãget-help NuGet
ãã¦ã¿ã¦ã¯ããããã¨ããã®ã§ãã¦ã¿ãã¨ãããInstall-Package
ã¨ããã³ãã³ããæã¦ã°è¯ãã®ã§ã¯ãªããã¨ããçµè«ã«ãªã£ãããã£ã¦ã¿ããã
PM> Install-Package iText '.NETFramework,Version=v4.7.2' ã対象ã¨ããããã¸ã§ã¯ã 'ScannedPdfTuner' ã«é¢ãã¦ãããã±ã¼ã¸ 'iText.9.0.0' ã®ä¾åé¢ä¿æ å ±ã®åéã試è¡ãã¦ãã¾ã ä¾åé¢ä¿æ å ±ã®åéã« 42 sec ãããã¾ãã DependencyBehavior 'Lowest' ã§ããã±ã¼ã¸ 'iText.9.0.0' ã®ä¾åé¢ä¿ã®è§£æ±ºã試è¡ãã¦ãã¾ã ä¾åé¢ä¿æ å ±ã®è§£æ±ºã« 0 ms ãããã¾ãã ããã±ã¼ã¸ 'iText.9.0.0' ãã¤ã³ã¹ãã¼ã«ããã¢ã¯ã·ã§ã³ã解決ãã¦ãã¾ã ããã±ã¼ã¸ 'iText.9.0.0' ãã¤ã³ã¹ãã¼ã«ããã¢ã¯ã·ã§ã³ã解決ããã¾ãã GET https://api.nuget.org/v3-flatcontainer/newtonsoft.json/13.0.1/newtonsoft.json.13.0.1.nupkg GET https://api.nuget.org/v3-flatcontainer/system.buffers/4.5.1/system.buffers.4.5.1.nupkg GET https://api.nuget.org/v3-flatcontainer/system.runtime.compilerservices.unsafe/5.0.0/system.runtime.compilerservices.unsafe.5.0.0.nupkg GET https://api.nuget.org/v3-flatcontainer/system.memory/4.5.4/system.memory.4.5.4.nupkg GET https://api.nuget.org/v3-flatcontainer/system.numerics.vectors/4.5.0/system.numerics.vectors.4.5.0.nupkg GET https://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging.abstractions/5.0.0/microsoft.extensions.logging.abstractions.5.0.0.nupkg GET https://api.nuget.org/v3-flatcontainer/microsoft.extensions.dependencyinjection.abstractions/5.0.0/microsoft.extensions.dependencyinjection.abstractions.5.0.0.nupkg GET https://api.nuget.org/v3-flatcontainer/microsoft.extensions.primitives/5.0.0/microsoft.extensions.primitives.5.0.0.nupkg OK https://api.nuget.org/v3-flatcontainer/system.memory/4.5.4/system.memory.4.5.4.nupkg 17 ããªç§ OK https://api.nuget.org/v3-flatcontainer/newtonsoft.json/13.0.1/newtonsoft.json.13.0.1.nupkg 18 ããªç§ OK https://api.nuget.org/v3-flatcontainer/system.runtime.compilerservices.unsafe/5.0.0/system.runtime.compilerservices.unsafe.5.0.0.nupkg 93 ããªç§ OK https://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging.abstractions/5.0.0/microsoft.extensions.logging.abstractions.5.0.0.nupkg 142 ããªç§ OK https://api.nuget.org/v3-flatcontainer/microsoft.extensions.dependencyinjection.abstractions/5.0.0/microsoft.extensions.dependencyinjection.abstractions.5.0.0.nupkg 144 ããªç§ OK https://api.nuget.org/v3-flatcontainer/system.numerics.vectors/4.5.0/system.numerics.vectors.4.5.0.nupkg 147 ããªç§ OK https://api.nuget.org/v3-flatcontainer/system.buffers/4.5.1/system.buffers.4.5.1.nupkg 150 ããªç§ OK https://api.nuget.org/v3-flatcontainer/microsoft.extensions.primitives/5.0.0/microsoft.extensions.primitives.5.0.0.nupkg 172 ããªç§ ã³ã³ãã³ã ããã·ã¥ ORj7Zh81gC69TyvmcUm9tSzytcy8AVousi+IVRAI8nLieQjOFryRusSFh7+aLk16FN9pQNqJAiMd7BTKINK0kA== ã® https://api.nuget.org/v3/index.json ãã Microsoft.Extensions.DependencyInjection.Abstractions 5.0.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã GET https://api.nuget.org/v3-flatcontainer/microsoft.extensions.options/5.0.0/microsoft.extensions.options.5.0.0.nupkg ã³ã³ãã³ã ããã·ã¥ NxP6ahFcBnnSfwNBi2KH2Oz8Xl5Sm2krjId/jRR3I7teFphwiUoUeZPwTNA21EX+5PtjqmyAvKaOeBXcJjcH/w== ã® https://api.nuget.org/v3/index.json ãã Microsoft.Extensions.Logging.Abstractions 5.0.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã GET https://api.nuget.org/v3-flatcontainer/system.diagnostics.diagnosticsource/5.0.0/system.diagnostics.diagnosticsource.5.0.0.nupkg ã³ã³ãã³ã ããã·ã¥ cI/VWn9G1fghXrNDagX9nYaaB/nokkZn0HYAawGaELQrl8InSezfe9OnfPZLcJq3esXxygh3hkq2c3qoV3SDyQ== ã® https://api.nuget.org/v3/index.json ãã Microsoft.Extensions.Primitives 5.0.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã GET https://api.nuget.org/v3-flatcontainer/system.threading.tasks.extensions/4.5.4/system.threading.tasks.extensions.4.5.4.nupkg ã³ã³ãã³ã ããã·ã¥ 1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw== ã® https://api.nuget.org/v3/index.json ãã System.Memory 4.5.4 ãã¤ã³ã¹ãã¼ã«ããã¾ããã OK https://api.nuget.org/v3-flatcontainer/microsoft.extensions.options/5.0.0/microsoft.extensions.options.5.0.0.nupkg 16 ããªç§ GET https://api.nuget.org/v3-flatcontainer/microsoft.bcl.asyncinterfaces/5.0.0/microsoft.bcl.asyncinterfaces.5.0.0.nupkg OK https://api.nuget.org/v3-flatcontainer/system.diagnostics.diagnosticsource/5.0.0/system.diagnostics.diagnosticsource.5.0.0.nupkg 19 ããªç§ ã³ã³ãã³ã ããã·ã¥ Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg== ã® https://api.nuget.org/v3/index.json ãã System.Buffers 4.5.1 ãã¤ã³ã¹ãã¼ã«ããã¾ããã GET https://api.nuget.org/v3-flatcontainer/microsoft.extensions.dependencyinjection/5.0.0/microsoft.extensions.dependencyinjection.5.0.0.nupkg ã³ã³ãã³ã ããã·ã¥ QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ== ã® https://api.nuget.org/v3/index.json ãã System.Numerics.Vectors 4.5.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã GET https://api.nuget.org/v3-flatcontainer/system.valuetuple/4.5.0/system.valuetuple.4.5.0.nupkg ã³ã³ãã³ã ããã·ã¥ ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA== ã® https://api.nuget.org/v3/index.json ãã System.Runtime.CompilerServices.Unsafe 5.0.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã GET https://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging/5.0.0/microsoft.extensions.logging.5.0.0.nupkg OK https://api.nuget.org/v3-flatcontainer/microsoft.bcl.asyncinterfaces/5.0.0/microsoft.bcl.asyncinterfaces.5.0.0.nupkg 26 ããªç§ OK https://api.nuget.org/v3-flatcontainer/system.threading.tasks.extensions/4.5.4/system.threading.tasks.extensions.4.5.4.nupkg 38 ããªç§ OK https://api.nuget.org/v3-flatcontainer/system.valuetuple/4.5.0/system.valuetuple.4.5.0.nupkg 30 ããªç§ OK https://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging/5.0.0/microsoft.extensions.logging.5.0.0.nupkg 33 ããªç§ OK https://api.nuget.org/v3-flatcontainer/microsoft.extensions.dependencyinjection/5.0.0/microsoft.extensions.dependencyinjection.5.0.0.nupkg 66 ããªç§ ã³ã³ãã³ã ããã·ã¥ ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A== ã® https://api.nuget.org/v3/index.json ãã Newtonsoft.Json 13.0.1 ãã¤ã³ã¹ãã¼ã«ããã¾ããã GET https://api.nuget.org/v3-flatcontainer/itext.commons/9.0.0/itext.commons.9.0.0.nupkg ã³ã³ãã³ã ããã·ã¥ W8DPQjkMScOMTtJbPwmPyj9c3zYSFGawDW3jwlBOOsnY+EzZFLgNQ/UMkK35JmkNOVPdCyPr2Tw7Vv9N+KA3ZQ== ã® https://api.nuget.org/v3/index.json ãã Microsoft.Bcl.AsyncInterfaces 5.0.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã 'nuget.org' ããããã±ã¼ã¸ 'itext 9.0.0' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'itext.commons 9.0.0' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'Microsoft.Bcl.AsyncInterfaces 5.0.0' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'Microsoft.Extensions.DependencyInjection 5.0.0' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'Microsoft.Extensions.DependencyInjection.Abstractions 5.0.0' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'Microsoft.Extensions.Logging 5.0.0' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'Microsoft.Extensions.Logging.Abstractions 5.0.0' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'Microsoft.Extensions.Options 5.0.0' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'Microsoft.Extensions.Primitives 5.0.0' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'Newtonsoft.Json 13.0.1' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'System.Buffers 4.5.1' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'System.Diagnostics.DiagnosticSource 5.0.0' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'System.Memory 4.5.4' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'System.Numerics.Vectors 4.5.0' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'System.Runtime.CompilerServices.Unsafe 5.0.0' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'System.Threading.Tasks.Extensions 4.5.4' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'System.ValueTuple 4.5.0' ãåå¾ãã¦ãã¾ãã GET https://api.nuget.org/v3-flatcontainer/itext/9.0.0/itext.9.0.0.nupkg OK https://api.nuget.org/v3-flatcontainer/itext.commons/9.0.0/itext.commons.9.0.0.nupkg 26 ããªç§ ã³ã³ãã³ã ããã·ã¥ CBvR92TCJ5uBIdd9/HzDSrxYak+0W/3+yxrNg8Qm6Bmrkh5L+nu6m3WeazQehcZ5q1/6dDA7J5YdQjim0165zg== ã® https://api.nuget.org/v3/index.json ãã Microsoft.Extensions.Options 5.0.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã ã³ã³ãã³ã ããã·ã¥ tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA== ã® https://api.nuget.org/v3/index.json ãã System.Diagnostics.DiagnosticSource 5.0.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã OK https://api.nuget.org/v3-flatcontainer/itext/9.0.0/itext.9.0.0.nupkg 27 ããªç§ ã³ã³ãã³ã ããã·ã¥ MgOwK6tPzB6YNH21wssJcw/2MKwee8b2gI7SllYfn6rvTpIrVvVS5HAjSU2vqSku1fwqRvWP0MdIi14qjd93Aw== ã® https://api.nuget.org/v3/index.json ãã Microsoft.Extensions.Logging 5.0.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã ã³ã³ãã³ã ããã·ã¥ okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ== ã® https://api.nuget.org/v3/index.json ãã System.ValueTuple 4.5.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã ã³ã³ãã³ã ããã·ã¥ zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg== ã® https://api.nuget.org/v3/index.json ãã System.Threading.Tasks.Extensions 4.5.4 ãã¤ã³ã¹ãã¼ã«ããã¾ããã ã³ã³ãã³ã ããã·ã¥ Rc2kb/p3Ze6cP6rhFC3PJRdWGbLvSHZc0ev7YlyeU6FmHciDMLrhoVoTUEzKPhN5ZjFgKF1Cf5fOz8mCMIkvpA== ã® https://api.nuget.org/v3/index.json ãã Microsoft.Extensions.DependencyInjection 5.0.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã ã³ã³ãã³ã ããã·ã¥ mfQuZz4beW2GOHMrtGay5iowg6WINBkHMm7hj38el3eDvWY3yLVZGrVxdWVRhEXJIdsXsBa3lPywxspsqi3rxg== ã® https://api.nuget.org/v3/index.json ãã itext.commons 9.0.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã ããã±ã¼ã¸ 'Microsoft.Extensions.DependencyInjection.Abstractions.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'Microsoft.Extensions.DependencyInjection.Abstractions.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'Microsoft.Extensions.DependencyInjection.Abstractions.5.0.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'Microsoft.Extensions.DependencyInjection.Abstractions 5.0.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'Microsoft.Extensions.Logging.Abstractions.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'Microsoft.Extensions.Logging.Abstractions.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'Microsoft.Extensions.Logging.Abstractions.5.0.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'Microsoft.Extensions.Logging.Abstractions 5.0.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'Newtonsoft.Json.13.0.1' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'Newtonsoft.Json.13.0.1' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ã³ã³ãã³ã ããã·ã¥ Y2nDUrXDO7eZ+dI2NZ10apW818OcgGklMWpLrVZ/P16rwSxpVyzjWZQjCgZVj8liSVhVDHy6eVJOrZah5KNhhQ== ã® https://api.nuget.org/v3/index.json ãã itext 9.0.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã ããã±ã¼ã¸ 'Newtonsoft.Json.13.0.1' ã 'packages.config' ã«è¿½å ãã¾ãã 'Newtonsoft.Json 13.0.1' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'System.Buffers.4.5.1' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'System.Buffers.4.5.1' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'System.Buffers.4.5.1' ã 'packages.config' ã«è¿½å ãã¾ãã 'System.Buffers 4.5.1' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'System.Numerics.Vectors.4.5.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'System.Numerics.Vectors.4.5.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'System.Numerics.Vectors.4.5.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'System.Numerics.Vectors 4.5.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'System.Runtime.CompilerServices.Unsafe.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'System.Runtime.CompilerServices.Unsafe.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'System.Runtime.CompilerServices.Unsafe.5.0.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'System.Runtime.CompilerServices.Unsafe 5.0.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'System.Memory.4.5.4' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'System.Memory.4.5.4' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'System.Memory.4.5.4' ã 'packages.config' ã«è¿½å ãã¾ãã 'System.Memory 4.5.4' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'Microsoft.Extensions.Primitives.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'Microsoft.Extensions.Primitives.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'Microsoft.Extensions.Primitives.5.0.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'Microsoft.Extensions.Primitives 5.0.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'Microsoft.Extensions.Options.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'Microsoft.Extensions.Options.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'Microsoft.Extensions.Options.5.0.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'Microsoft.Extensions.Options 5.0.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'System.Diagnostics.DiagnosticSource.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'System.Diagnostics.DiagnosticSource.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'System.Diagnostics.DiagnosticSource.5.0.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'System.Diagnostics.DiagnosticSource 5.0.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'System.Threading.Tasks.Extensions.4.5.4' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'System.Threading.Tasks.Extensions.4.5.4' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'System.Threading.Tasks.Extensions.4.5.4' ã 'packages.config' ã«è¿½å ãã¾ãã 'System.Threading.Tasks.Extensions 4.5.4' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'Microsoft.Bcl.AsyncInterfaces.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'Microsoft.Bcl.AsyncInterfaces.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'Microsoft.Bcl.AsyncInterfaces.5.0.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'Microsoft.Bcl.AsyncInterfaces 5.0.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'Microsoft.Extensions.DependencyInjection.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'Microsoft.Extensions.DependencyInjection.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'Microsoft.Extensions.DependencyInjection.5.0.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'Microsoft.Extensions.DependencyInjection 5.0.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'System.ValueTuple.4.5.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'System.ValueTuple.4.5.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'System.ValueTuple.4.5.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'System.ValueTuple 4.5.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'Microsoft.Extensions.Logging.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'Microsoft.Extensions.Logging.5.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'Microsoft.Extensions.Logging.5.0.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'Microsoft.Extensions.Logging 5.0.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'itext.commons.9.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'itext.commons.9.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'itext.commons.9.0.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'itext.commons 9.0.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'itext.9.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'itext.9.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'itext.9.0.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'itext 9.0.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã NuGet ã®æä½ã®å®è¡ã« 7.23 sec ãããã¾ãã çµéããæé: 00:00:50.8311032
ãã£ã±ãããããªãããä½ãããºããã¨ã¯èµ·ãã¦ããªãããã ã
Perplexityãæ示ãã¦ããããµã³ãã«éã(ã»ã¼ãã¡ãã£ã¨V9ã§å¤ãã£ã¦ããã¨ãããããããã )ããããªæãã®ã³ã¼ãã試ãã«æ¸ãã¦ã¿ãã
static void Main(string[] args) { using (PdfDocument pdfDoc = new PdfDocument( new PdfReader(@"C:\Users\318535760\desktop\hoge.pdf"), new PdfWriter(@"C:\Users\318535760\desktop\fuga.pdf"))) { PdfViewerPreferences vp = new PdfViewerPreferences(); vp.SetDirection( PdfViewerPreferences. PdfViewerPreferencesConstants.LEFT_TO_RIGHT); pdfDoc.GetCatalog().SetViewerPreferences(vp); } }
ã¨ã©ã¼ã«ãªã£ãã
NotSupportedException: Either com.itextpdf:bouncy-castle-adapter or com.itextpdf:bouncy-castle-fips-adapter dependency must be added in order to use BouncyCastleFactoryCreator
ãªããããã±ã¼ã¸ã足ããªãã¨è¨ã£ã¦ãããããªæ°ããããBouncy Castleã¨ããã®ã¯åãã¦èããããæå·åã®ã©ã¤ãã©ãªããããããã±ã¼ã¸åãé©å½ã«æ³åãã¦NuGetãã¦ã¿ãããããªã®ç¥ããªãã¨ä½åº¦ãè¨ãããå¾ã§ããããªãéã£ãã
PM> Install-Package itext.bouncy-castle-adapter '.NETFramework,Version=v4.7.2' ã対象ã¨ããããã¸ã§ã¯ã 'ScannedPdfTuner' ã«é¢ãã¦ãããã±ã¼ã¸ 'itext.bouncy-castle-adapter.9.0.0' ã®ä¾åé¢ä¿æ å ±ã®åéã試è¡ãã¦ãã¾ã ä¾åé¢ä¿æ å ±ã®åéã« 8.42 sec ãããã¾ãã DependencyBehavior 'Lowest' ã§ããã±ã¼ã¸ 'itext.bouncy-castle-adapter.9.0.0' ã®ä¾åé¢ä¿ã®è§£æ±ºã試è¡ãã¦ãã¾ã ä¾åé¢ä¿æ å ±ã®è§£æ±ºã« 0 ms ãããã¾ãã ããã±ã¼ã¸ 'itext.bouncy-castle-adapter.9.0.0' ãã¤ã³ã¹ãã¼ã«ããã¢ã¯ã·ã§ã³ã解決ãã¦ãã¾ã ããã±ã¼ã¸ 'itext.bouncy-castle-adapter.9.0.0' ãã¤ã³ã¹ãã¼ã«ããã¢ã¯ã·ã§ã³ã解決ããã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'BouncyCastle.Cryptography 2.4.0' ãåå¾ãã¦ãã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'itext.bouncy-castle-adapter 9.0.0' ãåå¾ãã¦ãã¾ãã GET https://api.nuget.org/v3-flatcontainer/bouncycastle.cryptography/2.4.0/bouncycastle.cryptography.2.4.0.nupkg GET https://api.nuget.org/v3-flatcontainer/itext.bouncy-castle-adapter/9.0.0/itext.bouncy-castle-adapter.9.0.0.nupkg OK https://api.nuget.org/v3-flatcontainer/bouncycastle.cryptography/2.4.0/bouncycastle.cryptography.2.4.0.nupkg 16 ããªç§ OK https://api.nuget.org/v3-flatcontainer/itext.bouncy-castle-adapter/9.0.0/itext.bouncy-castle-adapter.9.0.0.nupkg 16 ããªç§ ã³ã³ãã³ã ããã·ã¥ 2IcE6/X6YMBr9dgxsSK+934zXqi7UcdsYHapaa+aD7LLHgcbEABzyVNzsTrVEcNO4XJAMLVtqk4MP8dcVNiyQw== ã® https://api.nuget.org/v3/index.json ãã itext.bouncy-castle-adapter 9.0.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã ã³ã³ãã³ã ããã·ã¥ SwXsAV3sMvAU/Nn31pbjhWurYSjJ+/giI/0n6tCrYoupEK34iIHCuk3STAd9fx8yudM85KkLSVdn951vTng/vQ== ã® https://api.nuget.org/v3/index.json ãã BouncyCastle.Cryptography 2.4.0 ãã¤ã³ã¹ãã¼ã«ããã¾ããã ããã±ã¼ã¸ 'BouncyCastle.Cryptography.2.4.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'BouncyCastle.Cryptography.2.4.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'BouncyCastle.Cryptography.2.4.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'BouncyCastle.Cryptography 2.4.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã ããã±ã¼ã¸ 'itext.bouncy-castle-adapter.9.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'itext.bouncy-castle-adapter.9.0.0' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'itext.bouncy-castle-adapter.9.0.0' ã 'packages.config' ã«è¿½å ãã¾ãã 'itext.bouncy-castle-adapter 9.0.0' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã NuGet ã®æä½ã®å®è¡ã« 5 sec ãããã¾ãã çµéããæé: 00:00:14.7560642
ãªããå
¥ã£ãã£ã½ããããã§åãããªã»ã»ã»ããã¡ããã¨ç¶´ãæ¹ãå¤æ´ããããã¡ãªã¿ã«ãæå
ã®ãã³ã¬ããã¹ãã«ä½¿ã£ãã®ã§ãããå³ç¶´ãã«ãªã£ã¦ãããã®ã左綴ãã«æ»ãããä¸ã®ã³ã¼ãã¯LEFT_TO_RIGHT
ã«ãªã£ã¦ãããã©ãæ¬æ¥ããããã®ã¯éã§ããã
ããã«ããã¼ã¸ã®åé¤ããã¦ãããããPerplexityã«è³ªåãã¦ã¿ããPdfDocument.RemovePage()
ã§è¯ããããã1è¡è¿½å ããããã¡ããã¨ãã¼ã¸ãåé¤ããããããã§ã«ãã¼ã®è£ã®ç½ç´ãæ¶ããã
ç´ æ´ãããã
ãã¦ãå¾ã¯ãããã³ãã³ãã©ã¤ã³ãã¼ã«ã¨ãã¦ä½¿ãããã®ã§ãå¼æ°ã¨ããªãã·ã§ã³ã¨ããæ±ããããPerplexityã«ãC#ã£ã¦getoptã¿ãããªã®ãªãã®ï¼ãã¨èãã¦ã¿ãã¨ãããSystem.CommandLine
ã使ãã¨ã®ãã¨ã
using System.CommandLine
ã¨æ¸ãã¦ã¿ããã¨ã©ã¼ã«ãªãã®ã§ãNuGetããã°ããã®ããªï¼ããï¼Install-Package System.CommandLine
ã¯ããããªã®ãªãããã¨ããã¨ã©ã¼ã«ãªãã
NuGet Gallery | System.CommandLine 2.0.0-beta4.22272.1
ãè¦ã«è¡ã£ã¦ã¿ãã¨ãããããã¤ã¯ã¾ã prereleaseãªã®ã§ãlatestã§ã¯å ¥ããªãã¿ãããããæ¹ãæ¸ãã¦ãã£ãã®ã§ãã®éãã«ããã
PM> NuGet\Install-Package System.CommandLine -Version 2.0.0-beta4.22272.1 '.NETFramework,Version=v4.7.2' ã対象ã¨ããããã¸ã§ã¯ã 'ScannedPdfTuner' ã«é¢ãã¦ãããã±ã¼ã¸ 'System.CommandLine.2.0.0-beta4.22272.1' ã®ä¾åé¢ä¿æ å ±ã®åéã試è¡ãã¦ãã¾ã ä¾åé¢ä¿æ å ±ã®åéã« 1.76 sec ãããã¾ãã DependencyBehavior 'Lowest' ã§ããã±ã¼ã¸ 'System.CommandLine.2.0.0-beta4.22272.1' ã®ä¾åé¢ä¿ã®è§£æ±ºã試è¡ãã¦ãã¾ã ä¾åé¢ä¿æ å ±ã®è§£æ±ºã« 0 ms ãããã¾ãã ããã±ã¼ã¸ 'System.CommandLine.2.0.0-beta4.22272.1' ãã¤ã³ã¹ãã¼ã«ããã¢ã¯ã·ã§ã³ã解決ãã¦ãã¾ã ããã±ã¼ã¸ 'System.CommandLine.2.0.0-beta4.22272.1' ãã¤ã³ã¹ãã¼ã«ããã¢ã¯ã·ã§ã³ã解決ããã¾ãã 'nuget.org' ããããã±ã¼ã¸ 'System.CommandLine 2.0.0-beta4.22272.1' ãåå¾ãã¦ãã¾ãã GET https://api.nuget.org/v3-flatcontainer/system.commandline/2.0.0-beta4.22272.1/system.commandline.2.0.0-beta4.22272.1.nupkg OK https://api.nuget.org/v3-flatcontainer/system.commandline/2.0.0-beta4.22272.1/system.commandline.2.0.0-beta4.22272.1.nupkg 79 ããªç§ ã³ã³ãã³ã ããã·ã¥ 1uqED/q2H0kKoLJ4+hI2iPSBSEdTuhfCYADeJrAqERmiGQ2NNacYKRNEQ+gFbU4glgVyK8rxI+ZOe1onEtr/Pg== ã® https://api.nuget.org/v3/index.json ãã System.CommandLine 2.0.0-beta4.22272.1 ãã¤ã³ã¹ãã¼ã«ããã¾ããã ããã±ã¼ã¸ 'System.CommandLine.2.0.0-beta4.22272.1' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¦ãã¾ã ããã±ã¼ã¸ 'System.CommandLine.2.0.0-beta4.22272.1' ããã©ã«ãã¼ 'C:\Users\318535760\source\repos\ScannedPdfTuner\packages' ã«è¿½å ãã¾ãã ããã±ã¼ã¸ 'System.CommandLine.2.0.0-beta4.22272.1' ã 'packages.config' ã«è¿½å ãã¾ãã 'System.CommandLine 2.0.0-beta4.22272.1' ã ScannedPdfTuner ã«æ£å¸¸ã«ã¤ã³ã¹ãã¼ã«ããã¾ãã NuGet ã®æä½ã®å®è¡ã« 1.21 sec ãããã¾ãã çµéããæé: 00:00:03.1578211
使ãæ¹ã¯ãããèªãã
System.CommandLine でコマンドを定義する方法 - .NET | Microsoft Learn
å¤æ©è½ãªã®ã§èª¬æã¯é¢åãããããç¹ã«é£ãããã¨ããããã¨ãã¦ããããã§ã¯ãªãã®ã§ãã¡ã¾ã¡ã¾ã¨æ¸ãã¦ãã£ãã
ã©ããã¦mainé¢æ°ãasyncã«ãªã£ã¦ãTaskã¨ããããããããªããã®ãè¿ãããã«ãªã£ã¦ãã¾ã£ãã®ãã¯ããããããªãã®ã ãã»ã»ã»ã¾ãããã®ã¾ã¾ãããã¦ãããã
ã¨ããããã§ãæçµçã«ãããªæãã
using System; using System.Linq; using System.Threading.Tasks; using System.CommandLine; using System.IO; using iText.Kernel.Pdf; using Pvpc = iText.Kernel.Pdf.PdfViewerPreferences.PdfViewerPreferencesConstants; namespace ScannedPdfTuner { class Program { static async Task Main(string[] args) { var l2rOption = new Option<bool>( name: "--l2r", description: "左綴ãã«ãã¾ã"); l2rOption.AddAlias("-l"); var outDirOption = new Option<String>( name: "--outDir", description: "åºåå ãã£ã¬ã¯ããªå", getDefaultValue: () => "modify"); outDirOption.AddAlias("-o"); var inDirOption = new Option<String>( name: "--inDir", description: "å ¥åå ãã£ã¬ã¯ããªå", getDefaultValue: () => "target"); inDirOption.AddAlias("-i"); var rootCommand = new RootCommand("PDFãã¡ã¤ã«ãå³ç¶´ãã«ãã¦ã2ãã¼ã¸ç®ãåé¤ãã¾ã"); rootCommand.Add(l2rOption); rootCommand.Add(outDirOption); rootCommand.Add(inDirOption); rootCommand.SetHandler((l2rOptionValue, outDir, inDir) => { // åºåå ãã£ã¬ã¯ããªã空ã«ãã if (Directory.Exists(outDir)) { Directory.Delete(outDir, true); } Directory.CreateDirectory(outDir); var files = Directory.GetFiles(inDir, "*.pdf").Select((file) => Path.GetFileName(file)) foreach(var file in files) { using (PdfDocument pdfDoc = new PdfDocument( new PdfReader(Path.Combine(inDir, file)), new PdfWriter(Path.Combine(outDir, file)))) { // 綴ãæ¹ãå¤ãã PdfViewerPreferences vp = new PdfViewerPreferences(); vp.SetDirection(l2rOptionValue ? Pvpc.LEFT_TO_RIGHT : Pvpc.RIGHT_TO_LEFT); pdfDoc.GetCatalog().SetViewerPreferences(vp); // ã«ãã¼ã®è£ã®ç½ç´ãåé¤ãã pdfDoc.RemovePage(2); } } },l2rOption, outDirOption, inDirOption); await rootCommand.InvokeAsync(args); } } }
targetã¨ãããã£ã¬ã¯ããªãä½ã£ã¦ã¹ãã£ã³ããã¾ã¾ã®ãã¡ã¤ã«ãç½®ããå®è¡ããã¨ãmodifyã¨ãããã£ã¬ã¯ããªã«ä¿®æ£ããPDFãåºæ¥ãã
çµæã¯ãããªæããå·¦ãã¹ãã£ã³ããã°ããã®PDFãããã綴ãæ¹ãå¤ãã¦ã2ãã¼ã¸ç®ãæ¶ãã¨èªã¿ããããªãã
ãã¼ããPerplexityã«æä¼ã£ã¦ãããã¨éããªã¼ã