Click here to Skip to main content
15,896,507 members
Home / Discussions / C#
   

C#

 
QuestionHow to update data to existing PDF using Itextsharp library Pin
pondurelakshman30-Oct-18 19:27
pondurelakshman30-Oct-18 19:27 
AnswerRe: How to update data to existing PDF using Itextsharp library Pin
Richard MacCutchan31-Oct-18 3:09
mveRichard MacCutchan31-Oct-18 3:09 
QuestionWhat is good practice Pin
Member 1351454029-Oct-18 9:57
Member 1351454029-Oct-18 9:57 
AnswerRe: What is good practice Pin
BillWoodruff29-Oct-18 11:45
professionalBillWoodruff29-Oct-18 11:45 
SuggestionRe: What is good practice Pin
josda100030-Oct-18 6:51
josda100030-Oct-18 6:51 
GeneralRe: What is good practice Pin
BillWoodruff30-Oct-18 17:08
professionalBillWoodruff30-Oct-18 17:08 
AnswerRe: What is good practice Pin
Bernhard Hiller30-Oct-18 22:49
Bernhard Hiller30-Oct-18 22:49 
QuestionUsing InPlaceBitmapMetadataWriter To Write Keywords Failing on Photos from Recent Cameras Pin
richmhouse29-Oct-18 7:37
richmhouse29-Oct-18 7:37 
I have successfully used the InPlaceBitmapMetadataWriter to write Keywords to many photos taken by many cameras, including when I need to extend the metdata padding. However for photos taken by recent cameras the TrySave method always returns false for Keywords. Does anyone know why this might be and how I might solve this?

private bool UpdateMetadataInPlace()
        {
            bool traySaveSuccessful = false;
            string tempPath = PutTogetherTemporaryFilePath();

            // Copy original file to temp file and work on this because in place metadata update can corrupt file if it fails.
            if (File.Exists(tempPath))
            {
                File.Delete(tempPath);
            }
            File.Copy(imageFilePath, tempPath);

            using (Stream jpgFileStream = File.Open(tempPath, FileMode.Open, FileAccess.ReadWrite))
            {
                BitmapDecoder jpgDecoder = BitmapDecoder.Create(jpgFileStream, BitmapCreateOptions.None, BitmapCacheOption.None);

                if (jpgDecoder.Frames[0] != null && jpgDecoder.Frames[0].Metadata != null)
                {
                    InPlaceBitmapMetadataWriter metadataJpgWriter = jpgDecoder.Frames[0].CreateInPlaceBitmapMetadataWriter();

                    metadataJpgWriter.SetQuery("System.Keywords", Keywords.ToArray());

                    if (metadataJpgWriter.TrySave())
                    {
                        traySaveSuccessful = true;
                    }
                }
            }

            if (traySaveSuccessful == true)
            {
                File.Delete(imageFilePath);
                File.Move(tempPath, imageFilePath);
            }
            else
            {
                File.Delete(tempPath);
            }

            return traySaveSuccessful;
        }


modified 29-Oct-18 14:12pm.

QuestionScrolling reset when application regains focus Pin
pr1mem0ver29-Oct-18 2:58
pr1mem0ver29-Oct-18 2:58 
AnswerRe: Scrolling reset when application regains focus Pin
BillWoodruff29-Oct-18 11:55
professionalBillWoodruff29-Oct-18 11:55 
QuestionRookie needs help with array Pin
Member 1398787027-Oct-18 5:28
Member 1398787027-Oct-18 5:28 
AnswerRe: Rookie needs help with array Pin
Richard MacCutchan27-Oct-18 5:54
mveRichard MacCutchan27-Oct-18 5:54 
AnswerRe: Rookie needs help with array Pin
OriginalGriff27-Oct-18 6:12
mveOriginalGriff27-Oct-18 6:12 
GeneralRe: Rookie needs help with array Pin
Member 1398787028-Oct-18 12:39
Member 1398787028-Oct-18 12:39 
GeneralRe: Rookie needs help with array Pin
OriginalGriff28-Oct-18 20:58
mveOriginalGriff28-Oct-18 20:58 
Question[Solved]How i deserialize a specific JSON with Newtonsoft Pin
Kapparina26-Oct-18 13:35
Kapparina26-Oct-18 13:35 
AnswerRe: How i deserialize a specific JSON with Newtonsoft Pin
josda100026-Oct-18 17:45
josda100026-Oct-18 17:45 
GeneralRe:How i deserialize a specific JSON with Newtonsoft Pin
Kapparina26-Oct-18 18:11
Kapparina26-Oct-18 18:11 
GeneralRe:How i deserialize a specific JSON with Newtonsoft Pin
josda100029-Oct-18 6:10
josda100029-Oct-18 6:10 
QuestionHow do i do this assignment???? Pin
C#NoobHelpMe25-Oct-18 16:49
C#NoobHelpMe25-Oct-18 16:49 
AnswerRe: How do i do this assignment???? Pin
OriginalGriff25-Oct-18 19:29
mveOriginalGriff25-Oct-18 19:29 
AnswerRe: How do i do this assignment???? Pin
Richard MacCutchan25-Oct-18 21:23
mveRichard MacCutchan25-Oct-18 21:23 
JokeRe: How do i do this assignment???? Pin
Peter_in_278025-Oct-18 21:50
professionalPeter_in_278025-Oct-18 21:50 
GeneralRe: How do i do this assignment???? Pin
Richard MacCutchan25-Oct-18 21:52
mveRichard MacCutchan25-Oct-18 21:52 
GeneralRe: How do i do this assignment???? Pin
OriginalGriff26-Oct-18 0:47
mveOriginalGriff26-Oct-18 0:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.