• 카테고리
    • 전체 글

    • 카테고리1
    • 카테고리2
    • 카테고리3
    • 카테고리4
  • 태그
  • 방명록

'2021/01'에 해당되는 글 54건

  • 2021.01.13 CryptStream 예제 관련
  • 2021.01.13 텔레그램을 쓰는 이유 1
  • 2021.01.13 Bitnami Redmine for Windows 백업 1
  • 2021.01.13 Escrow 의 의미
  • 2021.01.13 벌써 8월 말..
  • 2021.01.13 블로그 이관.
  • 2021.01.13 NAS 컨버트 계획
  • 2021.01.13 PDF Writer for C#

CryptStream 예제 관련

카테고리 없음 2021. 1. 13. 19:38

C#을 이용해서 프로그램을 작성할 때, 암호화 관련되서는 대부분 CryptSteam 이라는 클래스를 이용하여 작성하곤 했다. 일단 Stream 계열로 작성되기 때문에, 매우 쉽게 접근할 수 있고 제작할 수 있어 매우 마음에 드는 구성이다.

그런데, 이 예제를 MS에서 제공하는 MSDN을 통해서 가져왔는데, 이 기법을 이용해서 빌드를 하게 되면, 중복 Dispose가 불린다는 Warning이 뜬다. 아마도 예제를 만든 사람은 C 계열 개발자 인듯. 매우 공격적으로 자원 해제를 하다가 보니, 중복 Dispose고 나발이고 작성된 것 같다. 프로그램 Run에는 문제가 없으나, 아마도 중복 Dispose로 인한 여러가지 수반되는 문제들이 있을 것은 어렵지 않게 예상된다.

먼저 MS에서 제공하는 예제는 다음 URL을 통해서 볼 수 있다.

CryptoStream Class(https://docs.micro…)

위의 내용 중 예제 부분만 추출하면 아래와 같다.

[ Encryption Part ]

// Create the streams used for encryption.
using (MemoryStream msEncrypt = new MemoryStream())
{                    
    using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write))
    {      
        using (StreamWriter swEncrypt = new StreamWriter(csEncrypt))
        {
            //Write all data to the stream.
            swEncrypt.Write(plainText);
        }
        encrypted = msEncrypt.ToArray();
    }
}

[ Decryption Part ]

// Create the streams used for decryption.
using (MemoryStream msDecrypt = new MemoryStream(cipherText))
{
    using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read))
    {
        using (StreamReader srDecrypt = new StreamReader(csDecrypt))
        {
            // Read the decrypted bytes from the decrypting stream
                            // and place them in a string.
               plaintext = srDecrypt.ReadToEnd();
        }
    }
}

문제는 위의 예제대로 하면 어김없이 발생한다는 것이다. using 이라는 구분을 쓰게 되는데, 이게 바로 그 문제의 원인.

그래서 고민을 했는데, 아래와 같이 수정하면 된다.

[ Encryption Part ]

// Create the streams used for encryption.
using (MemoryStream msEncrypt = new MemoryStream())
{
    CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write);
    StreamWriter swEncrypt = new StreamWriter(csEncrypt);
    {
        //Write all data to the stream.
        swEncrypt.Write(plainText);
        encrypted = msEncrypt.ToArray();
    }
}

 

[ Decryption Part ]

// Create the streams used for decryption.
using (MemoryStream msDecrypt = new MemoryStream(cipherText))
{
    CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read);
    StreamReader srDecrypt = new StreamReader(csDecrypt);
    {
        // Read the decrypted bytes from the decrypting stream
        // and place them in a string.
        plaintext = srDecrypt.ReadToEnd();
    }    
}

위와 같이 고치면 끝날까? 아직 끝나지 않았다. 그 이유는 Encoding 파트에서 발생된다.

중요 원인은 using이 가지는 특징 때문이다. using은 자체적으로 Dispose도 하지만, 그전에 자원을 모두 정리해주는 특성을 갖는다. 그래서 지금 저 Writer 부분에서 자체적으로 Dispose 하면서 자신이 갖은 데이터를 그대로 부을 수 있도록 해주기도 한다. 그러므로 무조건 using을 없애는 것은 답이 아니다.(실제 Debug로 해보면, Write를 하였음에도 불구하고 데이터가 없는 것 처럼 0 byte가 결과로 나온다.)

그러면 어떻게 해결해야 할까? Stack Overflow에서 확인해본 결과 Close를 해주면 깔끔하게 끝난다고 한다.

 

// Create the streams used for encryption.
using (MemoryStream msEncrypt = new MemoryStream())
{
    CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write);
    StreamWriter swEncrypt = new StreamWriter(csEncrypt);
    {
        //Write all data to the stream.
        swEncrypt.Write(plainText);
	  swEncrypt.Close();
        encrypted = msEncrypt.ToArray();
    }
}

내 코드에서도 위와 같은 문제가 발견되서 매우 당황했는데, 여튼 이번에 해결하게 되어 블로그로 남긴다.

Decrypt 부분은 위의 Encrypt와는 다르게 Close가 필요없다. 이미 데이터가 들어간 상태이고,  Write는 일단 캐쉬에 먼저 넣기 때문에 실제 데이터가 들어가 있지 않아서 발생된 문제다. 그러므로 그냥 using을 적당히 날리면 문제 없이 코드가 돌아간다.

2019. 11. 8. 오후 2:01

728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

텔레그램을 쓰는 이유

카테고리 없음 2021. 1. 13. 19:36

사실 우리나라에서 메신저는 역시 카카오톡이다. 모바일 전반적으로 다 쓰고, 거래처에서도 이 메신저를 가지고 업무의 내용을 주고 받는다. 심지어 가족들 사이에서도 이 메신저를 사용한다.

원활하긴 하다. 다만, 오로지 휴대폰으로만 할 때만이다.

만일 PC용을 사용하려할 때 말이 달라진다.
카카오톡 PC 버전이 없는 것은 아닌데, 문제는 광고다.
이게 무척 잦고 많고 시끄럽다.

툭하면 광고가 올라오고, 메시지 아래에 큼직하게 박혀 있다.
이윤을 추구하는 회사로써 꽁짜로 서비스를 사용하는 입장에서는 어쩔 수 없이 감당해야 하는 것일지는 모르겠지만 싫은 것은 싫기 때문이다. 요즘은 휴대폰용 메시전에서도 툭하면 나오기 시작했다.

텔레그램을 처음 사용한 이유는 서버가 해외에 위치해있고, 내부 암호화도 잘 구축되어 있어 안심하는 마음에 사용했지만, 요즘에 매우 애착가는 이유는 역시 광고가 전혀 없는 점이다. 이건 충분히 매력적인 것 같다.

모바일이든 PC든 어느 곳에도 광고라는 것이 존재하지 않고, 깔금하게 시작되고 깔끔하게 종료되니.

회사내에서 프로젝트 초기 때 주변에서 Slack Slack해서 Slack을 사용하긴 했는데, 이것도 금전적인 어느정도의 지원이 없으면 정작 활용도 높게 쓰지는 못하는것 같다. 차라리 이 대 텔레그램으로 할  걸이라는 생각이 가끔든다.

여튼 깔끔하게 사용하는 메시저가 필요하다면 역시 텔레그램이 좋은 것 같다.

2019. 10. 24. 오후 5:25

728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

Bitnami Redmine for Windows 백업

카테고리 없음 2021. 1. 13. 19:35


이 정보를 만든 원본 정보는 bitnami의 redmine 업그레이드 문서(https://docs.bitnami.com/installer/apps/redmine/administration/upgrade/)를 참고했습니다. 그 중, 업그레이드를 하기 전에 먼저 백업하는 부분만을 추출했습니다.


1. 7zip 준비.

압축 프로그램, 특히 command line으로 바로 실행할 수 있는 프로그램이 필요합니다. 저 같은 경우에는 7zip을 사용했으며, 설치된 7zip 프로그램들 중에 7z.exe 만을 사용했습니다. 일단 이 프로그램을 bitnami 에 설치된 위치에 사용했습니다.


2. Date 값 확인.

한글판 Windows를 사용하고 있다면, 거의 다 되겠지만, 일부 다른 언어권의 경우에는 Date 값을 조회할 때 폴더로 사용하기 다소 부적합 구성의 값이 나오는 경우가 있습니다.

이를 확인하는 방법은 간단합니다.

echo %date%

만일 yyyy-MM-dd 형식으로 나온다면 큰 문제는 없습니다. 만일 원하는 형태의 값이 안나온다면, google 등을 통해 날짜 값을 원하는 값으로 재 조립해주는 스크립트를 따야 합니다. 대개 for 문을 이용해서 땁니다.

저는 위의 명령을 넣으니 그냥 2019-10-24 이렇게 나와서 그냥 사용했습니다.


3. 설치 경로 확인.

Binami에서 제공하는 설치 프로그램으로 설치했다면, 대개 C:\Bitnami\redmine-4.0.1-3 뭐 이런식으로 잡혔을 겁니다. 이 경로를 파악해주셔야 합니다. 저 같은 경우에는 D:\Bitnami\4.0.3-3 에 설치되어 있습니다.


4. MySQL 접근 계정 확인하기.

MySQL 백업을 해야 하는데, 접근 계정 및 암호를 모른다면, 자동으로 백업하는 기능을 만들 수 없습니다. 실행할 때 마다, 암호를 물어보게 되는데, 매번 입력하는게 생각보다 어렵습니다. 게다가, Bitnami 솔루션으로 설치를 한 경우 자신에게 설치된 redmine용 MySQL 계정 정보를 잘 모르는게 당연합니다.

설치 경로를 기준으로 아래의 폴더로 이동합니다.

d:\Bitnami\4.0.3-3\apps\redmine\htdocs\config\

그리고 그 안에 있는 database.yml 파일을 엽니다.

내용을 보시고, 그 중, production: 에 있는 username과 password를 확인합니다.
대개 username은 bitnami 이고 password는 뭔가 랜덤하게 생성된 이상한 값일 겁니다. 이 정보들을 적당하게 보관하세요.


5. 백업 배치 파일 만들기.

위의 1~4까지의 정보를 가지고 아래의 배치 파일을 업데이트하면 됩니다.

SET BITNAMI=D:\Bitnami
SET BITNAMI_HOME=%BITNAMI%\4.0.3-3
SET BACKUPFOLDER=%BITNAMI%\Backup\%date%

IF NOT EXIST %BACKUPFOLDER% MKDIR %BACKUPFOLDER%

DEL /F /Q %BACKUPFOLDER%\*.*

%BITNAMI_HOME%\mysql\bin\mysqldump -u bitnami -p9109d4ddb7 --databases bitnami_redmine --add-drop-database > %BACKUPFOLDER%\bitnami_redmine.sql

%BITNAMI%\7z a -t7z -r "%BACKUPFOLDER%\redmine_files.7z" "%BITNAMI_HOME%\apps\redmine\htdocs\files\*.*"

%BITNAMI%\7z a -t7z -r "%BACKUPFOLDER%\redmine_plugins.7z" "%BITNAMI_HOME%\apps\redmine\htdocs\plugins\*.*"


맨 먼저 Bitnami 폴더를 잡아주세요. SET BITNAMI 옆의 경로 값인데, 이 위치에 Backup 이라는 폴더를 만들어 날짜별로 백업본을 담을 예정입니다.

그리고 SET BITNAMI_HOME 에 추가적인 경로를 넣어주세요. Redmine 홈은 버전 정보까지 해서 뭔가 더 있을 겁니다. 더 있는 값을 넣어주면 됩니다.

마지막으로 mysql\bin\mysqldump 에 있는 –p 에 앞서 확인헀던 암호로 넣어주세요. 주의할 사항은 –p 와 암호 사이에 공백이 있으면 안됩니다.

적당히 위의 내용으로 cmd 혹은 bat 파일을 만들고 실행해주시면 됩니다.


6. Task Schedule(작업 스케줄러)를 이용해서 자동 실행 설정.

주기적으로 자동 실행할 수 있도록 만들어주면 됩니다.



7. 마무리

백업 자체의 내용은 별 내용은 없습니다. 먼저 MySQL을 백업하고, files 폴더 안의 파일들과 plugin 폴더를 백업하는 정도 입니다. 다만, files 및 plugin 안의 내용이 많을 수 있어 압축하여 묶어주는 정도가 특이점 정도겠네요.

한 큐에 완성되었다고 내비두지 마시고, 반드시 배치 파일을 실행해서 잘 동작하는지 체크해주시는 것 잊지 마시고요~

2019. 10. 23. 오후 4:49

728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

Escrow 의 의미

카테고리 없음 2021. 1. 13. 19:34

Escrow라는 단어가 나타난 문서가 생겨서 매우 난감했다. 난감한 이유는 뜬금없이 나타나 어떤 의미를 갖는 것 같은데, 대체 무슨 의미를 나타내는 지 알 수 없었다.


단어 자체를 보면 그 단어의 이미는 무슨 예탁, 계약에 의한 거래 자체 뭐 그런 뜻으로 제시하는 것 같다.

  • 다음사전 : https://alldic.daum.net/search.do?q=escrow
  • 네이버사전 : https://dict.naver.com/search.nhn?dicQuery=escrow&query=escrow&target=dic&ie=utf8&query_utf=&isOnlyViewEE=

은행권 이야기면 그런가 싶긴한데, 애석하게도 내가 보는 문서는 장비에 관련된 규정 혹은 규약 같은 일종의 기술문서인데, 기술문서에서 금융 단어가 나오다니..


결국 이 직역에 가까운 단어 사용문구를 그대로 쓸 수 없다는 생각에 혹시나 해서 구글로 검색을 해봤다. 그런데, Wikipedia 쪽의 링크가 걸린 문서를 보게 되었고, 그 단어의 쓰임새를 가만히 바라보았다.

  • Wikipedia : https://en.wikipedia.org/wiki/Escrow

이 단어의 처음 부분으로는 대체 이해가 안되었다가, 맨 끝의 어원 부분에서 이런 뜻인가 싶었다.

….
The word derives from the Old French word escroue, meaning a scrap of paper or a scroll of parchment; this indicated the deed that a third party held until a transaction was completed.

대략적으로 보면, 이 단어는 예전 프랑스어인 escroue에서 나온 단어고 종이 조각 혹은 양피지 두루마리라는 단어라고 한다. 즉 이 단어가 가진 의미는 일종의 상호 확인을 위한 일종의 영수증, 계약서 같은 중요 문서를 나타내는 의미인 것이다.

지금 내가 확인하고 싶었던 사항은 Device with Escrow 였는데… 유가 증권을 처리할 정도의 권한을 갖는 장비 정도로 보면 될 것 같았다. 그냥 Bulk 성의 아무 정보나 처리하는 장비가 아니라, 매우 가치가 있고 권한 부여 문서등을 처리가능한 그런 장비로 해석이 가능했다.

역시 영어는 어렵다.;;;;;; 파도 파도 자주 쓰고 생활화 되지 않으면 역시 이해하기 쉽진 않다. 언어의 귀재들이 부러울 뿐;

2019. 10. 8. 오후 1:08

728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

벌써 8월 말..

카테고리 없음 2021. 1. 13. 19:33

예전 블로그 내용들을 모두 이관시키고 지금까지 익혀왔던 각종 기술들이나, 내용들에 대해서 새롭게 등록하려 했다.

그런데, 이전 글 이관시키기가 생각보다 쉽지 않았다. 일단 양이.. 더욱이 이미지 등이 겹치니 생각보다 어려운 일이 될 수 밖에 없었다. 이게 정리되어야 새로운 글을 작성할 수 있을텐데 말이다.

예전처럼 표준에 입각한 백업만 되었어도 간단하게 끝날일이 이렇게 힘들게만 되었다. 나중에 시간이 될 때 마다 이관 작업을 지속적으로 해야 겠다. 그렇게 정리되면 새롭게 글을 하나씩 채우고, 도메인도 옮길 예정이다.

생각처럼 잘 안되니 답답할 뿐이다.

2019. 8. 18. 오후 2:09

728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

블로그 이관.

카테고리 없음 2021. 1. 13. 19:31

지금까지 계속 Tistory를 이용하다가, Live Writer같은 Blog 도구 지원이 안되는 문제로 더 이상 포스팅을 하지 않고 있다.

그래서 Live Writer가 지원되는 블로그 서비스를 뒤적이다가, 결국 Google의 Bogger까지 왔고 이제 여기에 포스팅을 한다.

그런데, 문제가 Tistory는 이제 백업도 지원하지 않는다.
이 문제의 제일 큰 부분은 기존 글들을 자동으로 Blogger로 옮길 수 없다는 것이였다. 이건 정말이지….

결국 Tistory의 글과 그림을 다운로드 하는 Open Source를 구해 그걸로 받아 내릴 수 있었다. 자동으로 내려 받은게 아니다 보니 지금 손으로 하나하나 업로드 중이다. 단순하게 텍스트만 옮기는 거면, 프로그램으로 업로드 하면 되는데, 지금 문제되고 있는 부분은 이미지였다. 이 이미지를 포함시킬  방법이 없어서 난감한 상태다.

전체 글은 1100 여개 되는데, 지금 남은 글이 970개 정도가 남았다. 이 걸 다 등록하려면 어마어마한 시간이 요구될 거 같은데…

여튼 이거 완료되어야 내 도메인도 옮기고 정리할 수 있을텐데…

여러가지로 걸린다.

…

2019. 5. 15. 오전 1:57

728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

NAS 컨버트 계획

카테고리 없음 2021. 1. 13. 19:31

지금 N45L을 가지고 있다.
여기 설치된 운영체제는 Windows Server 2008 R2 인데, 원격데스크 톱이나, Windows 기반 서버 프로그램들로 대충 설정하고 운영을 해왔다.

그런데, 간혹 Windows 자체의 부하인지는 모르겠지만, 다운되어 시스템이 멈추는 경우가 종종 있다. 게다가, 원하는 성능보다 낮은 경우도 발생한다.

그러다 보니, 자연스럽게 다시 Synology를 보게 되었고, 그렇다고, 4~50만원씩 하는 제품을 사기엔 부담이 되는것도 사실이다. 약간은 고민 중이지만, 봐서 이 N45L을 Synology 화하는 것도 나쁠 것 같지는 않다.

http://xpenology.me/compatible/

나중에 찬찬히 해당 내용을 검토해서 업데이트해봐야 겠다.

헤놀로지, 해놀로지 라는 이름으로 검색을 해도 꽤 많은 자료들이 나오니
이를 참조해봐야 겠다.

2019. 3. 15. 오후 1:58

728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

PDF Writer for C#

카테고리 없음 2021. 1. 13. 19:29

매우 매력적인 프로젝트가 있었다.

https://www.codeproject.com/Articles/570682/PDF-File-Writer-Csharp-Class-Library-Version-1-22

PDF File Writer C# Class Library (Version 1.22.0)

요약 내용은 아래와 같다.

The PDF File Writer C# class library PdfFileWriter allows you to create PDF files directly from your .net application. The library shields you from the details of the PDF file structure. To use the library, you need to add a reference to the attached PdfFileWriter.dll class library file, add a using PdfFileWriter statement in every source file that uses the library and include the PdfFileWriter.dll with your distribution. For more details go to 4. Installation. Alternatively, you can include the source code of the library with your application and avoid the need to distribute a separate data link library file. The minimum development requirement is .NET Framework 4.6.2 (Compiled with Visual Studio 2017).

Version 1.22.0: Sticky Notes or Text Annotations

The PDF reference document defines Sticky Notes or Text Annotation in Section 8.4 page 621.  "A text annotation represents a “sticky note” attached to a point in the PDF document. When closed, the annotation appears as an icon; when open, it displays a pop-up window containing the text of the note in a font and size chosen by the viewer application. Text annotations do not scale and rotate with the page; they behave as if the NoZoom and NoRotate annotation flags (see Table 8.16 on page 608) were always set. Table 8.23 shows the annotation dictionary entries specific to this type of annotation." See Section 2.24 Sticky Notes or Text Annotation.

The PDF File Writer C# class library supports the following PDF document's features:

  • Graphics: drawing lines, rectangles, polygons, Bezier curves, foreground and background color, patterns and shading. Section 2.1 Coordinate System.
  • Image: drawing raster (Bitmap) images and vector (Metafile) images. Section 2.4. Image Support.
  • Text: drawing text lines and text in columns. Section 2.3 Language Support.
  • Barcode: support for Barcode 128, Barcode 39, Barcode interleaved 2 of 5, Barcode EAN13 and Barcode UPC-A. Section 2.5 Barcode Support.
  • QR Code: support for two dimensions barcode. Section 2.8 QR Code Support.
  • Encryption: support for AES-128 encryption. Section 2.6 Encryption Support.
  • Web Link: Web link interactive support. Section 2.7 Web Link Support.
  • Bookmark: Support for document outline. Section 2.9 Bookmark Support.
  • Named Destinations: Support for making Acrobat open the PDF document at a specific page. Section 2.22 Document Links and Named Destinations.
  • Charts: Support for Microsoft Charting. Section 2.10 Charting Support.
  • Print to PDF: Create a PDF document from PrintDocument process. Section 2.11 PrintDocument Support.
  • Display data tables. Section 2.12 Data Table Support
  • Play video files. Section 2.13 Play Video Files
  • Play sound files. Section 2.14 Play Sound Files
  • Attach data files. Section 2.15 Attach Data Files
  • Reorder pages. Section 2.16 Reorder Pages
  • PDF document output to a file or to a stream. Section 2.17 PDF Document Output.
  • PDF document information dictionary. The PDF reader displays this information in the Description tab of the document properties. The information includes: Title, Author, Subject, Keywords, Created date and time, Modified date and time, the Application that produced the file, the PDF Producer. Section 2.18 Document Information Dictionary.
  • Memory control: Write contents information of completed pages to output file and free unused memory with garbage collector. Section 2.19. Memory Control.
  • Draw artwork defined by System.Windows.Media.PathGeometry class. Input argument can be text string or PathGeometry class. Section 2.20 Windows Presentation Foundation WPF
  • Transparency or opaqueness is now available for painting shapes, lines, text and images. Your application can set the alpha component of color for all graphics and text. Section 2.21 Transparency, Opacity, Alpha Color Component and Blending
  • Blend. The new library supports the PDF color blending scheme. Blending defines how the color of a new item painted over a previous item is handled. Section 2.21 Transparency, Opacity, Alpha Color Component and Blending
  • Document Links and Named Destination. Section 2.22 Document Links and Named Destination.
  • PDF417 barcode. Section 2.23 PDF417 Barcode.

Creating a PDF is a six steps process.

  • Step 1: Create one document object PdfDocument.
  • Step 2: Create resource objects such as fonts or images (i.e. PdfFont or PdfImage).
  • Step 3: Create page object PdfPage.
  • Step 4: Create contents object PdfContents.
  • Step 5: Add text and graphics to the contents object (using PdfContents methods).
  • Repeat steps 3, 4 and 5 for additional pages
  • Step 6: Create your PDF document file by calling CreateFile method of PdfDocument.

Step 5 is where most of your programming effort will be spent. Adding contents is achieved by calling the methods of PdfContents class to render graphics and text. The contents class has a rich set (about 100) of methods for adding text and graphics to your document.

PdfDocument implements the IDisposable interface to release unmanaged resources. The CreateFile method calls Document.Dispose() after the PDF file is created. However, to ensure the release of resources you should wrap the PdfDocument creation and the final CreateFile with either a using statement or a try/catch block./p>

The demo program attached to this article is the test program developed to debug the library. The TestPdfFileWriter has six buttons on the main screen. Five buttons to produce examples of PDF files and one button to display all fonts available on your computer. The first button “Article Example” creates the PDF file displayed at the top of this article. Section 3. Development Guide by Example.

As stated before, the PdfFileWriter C# class library shields you from the complexities of the PDF file structure. However, good understanding of PDF file is always an advantage. Adobe PDF file specification document available from Adobe website: “PDF Reference, Sixth Edition, Adobe Portable Document Format Version 1.7 November 2006”. It is an intimidating 1310 pages document. I would strongly recommend reading Chapter 4 Graphics and sections 5.2 and 5.3 of the Text chapter 5.

If you want to analyze the PDF files created by this project, or if you want to understand PDF file structure in general, you can use the demo program attached to my previous article "PDF File Analyzer With C# Parsing Classes". This article provides a concise overview of the PDF specifications.


일단 백업 차원에서 해당 파일도 여기에 등록해보도록 한다.
(링크가 사라져서 곤란한적이 여러번;;;)

PdfFileWriter_demo.zip

PdfFileWriter_dll.zip

PdfFileWriter_example.zip

PdfFileWriter_src.zip

2019. 2. 21. 오후 5:31

728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

  • «
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • »
250x250

블로그 내에 소스 코드 삽입 이사온 기념 스킨도... RSS 전문 기능 비활성화 관련. 스킨 바꾸어 보았습니다. 서버 파일 정리 좀 했습니다.

«   2021/01   »
일 월 화 수 목 금 토
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

블로그 me2sms 지름신 twi2me moss 인터파크 개발환경 오류 WSS 2010 Tutorial Google Apps Engine 협업 Visual Studio 친구 e-book 것 좀 me2dayzm java 불만 비스킷 MOSS 2007 Buscuit Azure me2photo 수 windows 매뉴얼 SharePoint

  • Total :
  • Today :
  • Yesterday :

Copyright © 2015-2025 Socialdev. All Rights Reserved.

Copyright © 2015-2025 Socialdev. All Rights Reserved.

티스토리툴바